From b9b85843572bf283f48285001e276ba7e61b63f6 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Feb 2009 13:37:51 +0100 Subject: updated to MediaWiki 1.14.0 --- includes/SearchOracle.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'includes/SearchOracle.php') diff --git a/includes/SearchOracle.php b/includes/SearchOracle.php index bf9368d1..b48d5e6e 100644 --- a/includes/SearchOracle.php +++ b/includes/SearchOracle.php @@ -77,9 +77,10 @@ class SearchOracle extends SearchEngine { function queryNamespaces() { if( is_null($this->namespaces) ) return ''; - $namespaces = implode(',', $this->namespaces); - if ($namespaces == '') { + if ( !count( $this->namespaces ) ) { $namespaces = '0'; + } else { + $namespaces = $this->db->makeList( $this->namespaces ); } return 'AND page_namespace IN (' . $namespaces . ')'; } @@ -144,7 +145,10 @@ class SearchOracle extends SearchEngine { 'WHERE page_id=si_page AND ' . $match; } - /** @todo document */ + /** + * Parse a user input search string, and return an SQL fragment to be used + * as part of a WHERE clause + */ function parseQuery($filteredText, $fulltext) { global $wgContLang; $lc = SearchEngine::legalSearchChars(); @@ -170,9 +174,9 @@ class SearchOracle extends SearchEngine { } } - $searchon = $this->db->strencode(join(',', $q)); + $searchon = $this->db->addQuotes(join(',', $q)); $field = $this->getIndexField($fulltext); - return " CONTAINS($field, '$searchon', 1) > 0 "; + return " CONTAINS($field, $searchon, 1) > 0 "; } /** -- cgit v1.2.2