<?php
+use MediaWiki\MediaWikiServices;
use MediaWiki\Widget\TitleInputWidget;
/**
$title = Title::newFromTextThrow( $value );
} else {
// Can't use Title::makeTitleSafe(), because it doesn't throw useful exceptions
- global $wgContLang;
- $namespaceName = $wgContLang->getNsText( $this->mParams['namespace'] );
+ $namespaceName = MediaWikiServices::getInstance()->getContentLanguage()->
+ getNsText( $this->mParams['namespace'] );
$title = Title::newFromTextThrow( $namespaceName . ':' . $value );
}
} catch ( MalformedTitleException $e ) {