X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftitle%2FNaiveImportTitleFactory.php;h=4da939511c0fa80668acc5c72644aa64fe61fdf4;hb=8ef70696d8f1fd2687c09b42c62fb9d285cfc78f;hp=5cb6112014d59776b6a92d9591b5cab07b626449;hpb=11ee7f78da9776db26098642a151a288f98bea14;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/title/NaiveImportTitleFactory.php b/includes/title/NaiveImportTitleFactory.php index 5cb6112014..4da939511c 100644 --- a/includes/title/NaiveImportTitleFactory.php +++ b/includes/title/NaiveImportTitleFactory.php @@ -18,6 +18,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * A class to convert page titles on a foreign wiki (ForeignTitle objects) into * page titles on the local wiki (Title objects), using a default namespace @@ -39,8 +41,6 @@ class NaiveImportTitleFactory implements ImportTitleFactory { * @return Title|null */ public function createTitleFromForeignTitle( ForeignTitle $foreignTitle ) { - global $wgContLang; - if ( $foreignTitle->isNamespaceIdKnown() ) { $foreignNs = $foreignTitle->getNamespaceId(); @@ -53,7 +53,8 @@ class NaiveImportTitleFactory implements ImportTitleFactory { // Do we have a local namespace by the same name as the foreign // namespace? - $targetNs = $wgContLang->getNsIndex( $foreignTitle->getNamespaceName() ); + $targetNs = MediaWikiServices::getInstance()->getContentLanguage()->getNsIndex( + $foreignTitle->getNamespaceName() ); if ( $targetNs !== false ) { return Title::makeTitleSafe( $targetNs, $foreignTitle->getText() ); }