Merge "Skip 64 bit MWMessagePack tests on 32 bit machines"
[lhc/web/wiklou.git] / includes / search / SearchResultSet.php
index f430dd0..698f93c 100644 (file)
@@ -173,7 +173,12 @@ class SqlSearchResultSet extends SearchResultSet {
        }
 
        function getTotalHits() {
-               return $this->totalHits;
+               if ( !is_null( $this->totalHits ) ) {
+                       return $this->totalHits;
+               } else {
+                       // Special:Search expects a number here.
+                       return $this->numRows();
+               }
        }
 }