Avoid usage of deprecated $wgContLang global (dep in 1.32)

Change-Id: I3c5413392871d11cf363db6f88ee80ac030daabb
This commit is contained in:
Derick Alangi 2019-09-02 10:32:55 +01:00
parent 04e919b20b
commit d60de7d63a

View file

@ -1,5 +1,7 @@
<?php
use MediaWiki\MediaWikiServices;
class SpecialCiteThisPage extends FormSpecialPage {
/**
@ -145,9 +147,10 @@ class SpecialCiteThisPage extends FormSpecialPage {
# and the text moved into SpecialCite.i18n.php
# This code is kept for b/c in case an installation has its own file "citethispage-content-xx"
# for a previously not supported language.
global $wgContLang, $wgContLanguageCode;
global $wgContLanguageCode;
$dir = __DIR__ . '/../';
$code = $wgContLang->lc( $wgContLanguageCode );
$code = MediaWikiServices::getInstance()->getContentLanguage()
->lc( $wgContLanguageCode );
if ( file_exists( "${dir}citethispage-content-$code" ) ) {
$msg = file_get_contents( "${dir}citethispage-content-$code" );
} elseif ( file_exists( "${dir}citethispage-content" ) ) {