From ea0e6ea45c07b0518c3eff27b8dc84969e950de9 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Thu, 21 Apr 2011 05:43:52 +0000 Subject: [PATCH] Fixed SearchMySQL broken by r80856 --- includes/search/SearchMySQL.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index 4adfef41af..d68fca08b1 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -290,14 +290,18 @@ class SearchMySQL extends SearchEngine { function getCountQuery( $filteredTerm, $fulltext ) { $match = $this->parseQuery( $filteredTerm, $fulltext ); + $redir = $this->queryRedirect(); + $namespaces = $this->queryNamespaces(); + $conditions = array( 'page_id=si_page', $match ); + if ( $redir !== '' ) { + $conditions[] = $redir; + } + if ( $namespaces !== '' ) { + $conditions[] = $namespaces; + } return $this->db->selectSQLText( array( 'page', 'searchindex' ), 'COUNT(*) AS c', - array( - 'page_id=si_page', - $match, - $this->queryRedirect(), - $this->queryNamespaces() - ), + $conditions, __METHOD__ ); } -- 2.20.1