Index: trunk/phase3/includes/api/ApiOpenSearch.php |
— | — | @@ -48,14 +48,19 @@ |
49 | 49 | $limit = $params['limit']; |
50 | 50 | $namespaces = $params['namespace']; |
51 | 51 | $suggest = $params['suggest']; |
52 | | - # $wgEnableMWSuggest hit incoming when $wgEnableMWSuggest is disabled |
53 | | - if( $suggest && !$wgEnableMWSuggest ) return; |
54 | | - |
55 | | - // Open search results may be stored for a very long time |
56 | | - $this->getMain()->setCacheMaxAge(1200); |
57 | 52 | |
58 | | - $srchres = PrefixSearch::titleSearch( $search, $limit, $namespaces ); |
| 53 | + // $wgEnableMWSuggest hit incoming when $wgEnableMWSuggest is |
| 54 | + // disabled |
| 55 | + if( $suggest && !$wgEnableMWSuggest ) |
| 56 | + $srchres = array(); |
| 57 | + else { |
| 58 | + // Open search results may be stored for a very long |
| 59 | + // time |
| 60 | + $this->getMain()->setCacheMaxAge(1200); |
59 | 61 | |
| 62 | + $srchres = PrefixSearch::titleSearch( $search, $limit, |
| 63 | + $namespaces ); |
| 64 | + } |
60 | 65 | // Set top level elements |
61 | 66 | $result = $this->getResult(); |
62 | 67 | $result->addValue(null, 0, $search); |