Removed all instances of empty() where error suppression was not intended. Replaced...
[lhc/web/wiklou.git] / includes / api / ApiQuerySearch.php
index 932ca50..639079c 100644 (file)
@@ -54,7 +54,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                $limit = $params['limit'];
                $query = $params['search'];
                $what = $params['what'];
-               if (is_null($query) || empty($query))
+               if (strval($query) === '')
                        $this->dieUsage("empty search string is not allowed", 'param-search');
 
                $search = SearchEngine::create();
@@ -93,8 +93,9 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                break;
                        }
 
-                       // Silently skip broken titles
-                       if ($result->isBrokenTitle()) continue;
+                       // Silently skip broken and missing titles
+                       if ($result->isBrokenTitle() || $result->isMissingRevision())
+                               continue;
                        
                        $title = $result->getTitle();
                        if (is_null($resultPageSet)) {