(bug 13482) Disabled search types handled properly
[lhc/web/wiklou.git] / includes / api / ApiQuerySearch.php
index b2a10b5..a014b57 100644 (file)
@@ -65,6 +65,9 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                        $matches = $search->searchText( $query );
                else
                        $matches = $search->searchTitle( $query );
+               if (is_null($matches))
+                       $this->dieUsage("{$params['what']} search is disabled", 
+                                       "search-{$params['what']}-disabled");
 
                $data = array ();
                $count = 0;