* @param string $term
*/
public function showResults( $term ) {
- global $wgContLang;
-
if ( $this->searchEngineType !== null ) {
$this->setExtraParam( 'srbackend', $this->searchEngineType );
}
$this->searchConfig,
$this->getSearchProfiles()
);
- $filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':';
+ $filePrefix = MediaWikiServices::getInstance()->getContentLanguage()->
+ getFormattedNsText( NS_FILE ) . ':';
if ( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
// Empty query -- straight view of search form
if ( !Hooks::run( 'SpecialSearchResultsPrepend', [ $this, $out, $term ] ) ) {
*/
public function getSearchEngine() {
if ( $this->searchEngine === null ) {
+ $services = MediaWikiServices::getInstance();
$this->searchEngine = $this->searchEngineType ?
- MediaWikiServices::getInstance()->getSearchEngineFactory()->create( $this->searchEngineType ) :
- MediaWikiServices::getInstance()->newSearchEngine();
+ $services->getSearchEngineFactory()->create( $this->searchEngineType ) :
+ $services->newSearchEngine();
}
return $this->searchEngine;