X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchMySQL.php;h=78eba2d0cf1781773e734cc062d5414695885fc5;hb=5a3181912beb9baf59c1d188467c1af852983896;hp=8ff2640c572c18e14e9f628f1acaa9bfff49a443;hpb=e50ef5784e237ce26c91ec402cb94669c78e303e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index 8ff2640c57..78eba2d0cf 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -174,8 +174,6 @@ class SearchMySQL extends SearchDatabase { } protected function searchInternal( $term, $fulltext ) { - global $wgCountTotalSearchHits; - // This seems out of place, why is this called with empty term? if ( trim( $term ) === '' ) { return null; @@ -189,19 +187,17 @@ class SearchMySQL extends SearchDatabase { ); $total = null; - if ( $wgCountTotalSearchHits ) { - $query = $this->getCountQuery( $filteredTerm, $fulltext ); - $totalResult = $this->db->select( - $query['tables'], $query['fields'], $query['conds'], - __METHOD__, $query['options'], $query['joins'] - ); - - $row = $totalResult->fetchObject(); - if ( $row ) { - $total = intval( $row->c ); - } - $totalResult->free(); + $query = $this->getCountQuery( $filteredTerm, $fulltext ); + $totalResult = $this->db->select( + $query['tables'], $query['fields'], $query['conds'], + __METHOD__, $query['options'], $query['joins'] + ); + + $row = $totalResult->fetchObject(); + if ( $row ) { + $total = intval( $row->c ); } + $totalResult->free(); return new SqlSearchResultSet( $resultSet, $this->searchTerms, $total ); } @@ -307,6 +303,8 @@ class SearchMySQL extends SearchDatabase { /** * @since 1.18 (changed) + * @param string $filteredTerm + * @param bool $fulltext * @return array */ function getCountQuery( $filteredTerm, $fulltext ) { @@ -378,6 +376,7 @@ class SearchMySQL extends SearchDatabase { /** * Converts some characters for MySQL's indexing to grok it correctly, * and pads short words to overcome limitations. + * @param string $string * @return mixed|string */ function normalizeText( $string ) { @@ -426,6 +425,7 @@ class SearchMySQL extends SearchDatabase { * Armor a case-folded UTF-8 string to get through MySQL's * fulltext search without being mucked up by funny charset * settings or anything else of the sort. + * @param array $matches * @return string */ protected function stripForSearchCallback( $matches ) {