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

Change-Id: Ia87a464c22be764deacd699fb66f96a663ccfe7c
This commit is contained in:
Derick Alangi 2019-09-02 09:49:09 +01:00
parent 19c69f4158
commit b9c0f0709b

View file

@ -202,9 +202,9 @@ abstract class BaseBlacklist {
* @return bool|string
*/
public static function getTypeFromTitle( Title $title ) {
global $wgContLang;
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
$types = array_map( [ $wgContLang, 'ucfirst' ], array_keys( self::$blacklistTypes ) );
$types = array_map( [ $contLang, 'ucfirst' ], array_keys( self::$blacklistTypes ) );
$regex = '/(' . implode( '|', $types ) . ')-(?:blacklist|whitelist)/';
if ( preg_match( $regex, $title->getDBkey(), $m ) ) {