With I8a47a8500922906bd4e4936b59b657de3bb9abdc Language::equals can
directly and faster compare the objects.
$wgLanguageCode can differ from $wgContLang->getCode() when a deprecated
language code is used. This change prevents this because Language
replaces deprecated language codes in Language::factory().
Change-Id: I07f47eceff8b3a4192278b1e9e1cfd9a41816a1c
* @return bool
*/
public static function useFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
+ global $wgContLang;
$config = MediaWikiServices::getInstance()->getMainConfig();
if ( !$config->get( 'UseFileCache' ) && $mode !== self::MODE_REBUILD ) {
$ulang = $context->getLanguage();
// Check that there are no other sources of variation
- if ( $user->getId() || $ulang->getCode() !== $config->get( 'LanguageCode' ) ) {
+ if ( $user->getId() || !$ulang->equals( $wgContLang ) ) {
return false;
}