mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ParserFunctions
synced 2024-11-24 00:06:21 +00:00
Replace deprecated Language::isValidBuiltInCode and Language::factory
Change-Id: I4c5bf4d68bcb79da33864dbffe395e3818050eb4
This commit is contained in:
parent
a29459d71c
commit
6468bf9ebb
|
@ -512,9 +512,10 @@ class ParserFunctions {
|
|||
wfMessage( 'pfunc_time_too_small' )->inContentLanguage()->escaped() .
|
||||
'</strong>';
|
||||
} elseif ( $ts < 100000000000000 ) { // Language can't deal with years after 9999
|
||||
if ( $language !== '' && Language::isValidBuiltInCode( $language ) ) {
|
||||
$services = MediaWikiServices::getInstance();
|
||||
if ( $language !== '' && $services->getLanguageNameUtils()->isValidBuiltInCode( $language ) ) {
|
||||
// use whatever language is passed as a parameter
|
||||
$langObject = Language::factory( $language );
|
||||
$langObject = $services->getLanguageFactory()->getLanguage( $language );
|
||||
} else {
|
||||
// use wiki's content language
|
||||
$langObject = $parser->getFunctionLang();
|
||||
|
|
Loading…
Reference in a new issue