Merge "Improve hidden field validation"
[lhc/web/wiklou.git] / includes / search / SearchSqlite.php
index 8e820f3..eee6930 100644 (file)
@@ -38,6 +38,8 @@ class SearchSqlite extends SearchDatabase {
         * Parse the user's query and transform it into an SQL fragment which will
         * become part of a WHERE clause
         *
+        * @param string $filteredText
+        * @param bool $fulltext
         * @return string
         */
        function parseQuery( $filteredText, $fulltext ) {
@@ -164,7 +166,7 @@ class SearchSqlite extends SearchDatabase {
        }
 
        protected function searchInternal( $term, $fulltext ) {
-               global $wgCountTotalSearchHits, $wgContLang;
+               global $wgContLang;
 
                if ( !$this->fulltextSearchSupported() ) {
                        return null;
@@ -174,14 +176,12 @@ class SearchSqlite extends SearchDatabase {
                $resultSet = $this->db->query( $this->getQuery( $filteredTerm, $fulltext ) );
 
                $total = null;
-               if ( $wgCountTotalSearchHits ) {
-                       $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) );
-                       $row = $totalResult->fetchObject();
-                       if ( $row ) {
-                               $total = intval( $row->c );
-                       }
-                       $totalResult->free();
+               $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) );
+               $row = $totalResult->fetchObject();
+               if ( $row ) {
+                       $total = intval( $row->c );
                }
+               $totalResult->free();
 
                return new SqlSearchResultSet( $resultSet, $this->searchTerms, $total );
        }