X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchOracle.php;h=9cd245a8603cc2318510eadddd840c7d3ceaeb79;hb=0770f85a0a293e6c7af6f1d3d3a1dbd2d13c1e09;hp=6d7e9886633c78d5bd61a5f4bee56c01a75811b0;hpb=32fd2342e5648ec7d37eecb00fc4044a3a7526a9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchOracle.php b/includes/search/SearchOracle.php index 6d7e988663..9cd245a860 100644 --- a/includes/search/SearchOracle.php +++ b/includes/search/SearchOracle.php @@ -24,6 +24,8 @@ * @ingroup Search */ +use MediaWiki\MediaWikiServices; + /** * Search engine hook base class for Oracle (ConText). * @ingroup Search @@ -173,7 +175,6 @@ class SearchOracle extends SearchDatabase { * @return string */ private function parseQuery( $filteredText, $fulltext ) { - global $wgContLang; $lc = $this->legalSearchChars( self::CHARS_NO_SYNTAX ); $this->searchTerms = []; @@ -185,7 +186,8 @@ class SearchOracle extends SearchDatabase { foreach ( $m as $terms ) { // Search terms in all variant forms, only // apply on wiki with LanguageConverter - $temp_terms = $wgContLang->autoConvertToAllVariants( $terms[2] ); + $temp_terms = MediaWikiServices::getInstance()->getContentLanguage()-> + autoConvertToAllVariants( $terms[2] ); if ( is_array( $temp_terms ) ) { $temp_terms = array_unique( array_values( $temp_terms ) ); foreach ( $temp_terms as $t ) { @@ -212,8 +214,7 @@ class SearchOracle extends SearchDatabase { } private function escapeTerm( $t ) { - global $wgContLang; - $t = $wgContLang->normalizeForSearch( $t ); + $t = MediaWikiServices::getInstance()->getContentLanguage()->normalizeForSearch( $t ); $t = isset( $this->reservedWords[strtoupper( $t )] ) ? '{' . $t . '}' : $t; $t = preg_replace( '/^"(.*)"$/', '($1)', $t ); $t = preg_replace( '/([-&|])/', '\\\\$1', $t );