* (bug 13010) Invalid language codes should fallback to default wiki language not English
Patch by Alexandre Emsenhuber
This commit is contained in:
parent
c07e337da6
commit
b8ec8a526c
2 changed files with 6 additions and 1 deletions
|
|
@ -105,7 +105,7 @@ class StubUserLang extends StubObject {
|
|||
$code = $wgContLanguageCode;
|
||||
}
|
||||
|
||||
if( $code === $wgContLanguageCode ) {
|
||||
if( $code === $wgContLanguageCode || !Language::localisationExist( $code ) ) {
|
||||
return $wgContLang;
|
||||
} else {
|
||||
$obj = Language::factory( $code );
|
||||
|
|
@ -135,3 +135,4 @@ class StubUser extends StubObject {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2013,6 +2013,10 @@ class Language {
|
|||
return self::getFileName( "$IP/languages/classes/Language", $code, '.php' );
|
||||
}
|
||||
|
||||
static function localisationExist( $code ){
|
||||
return ( file_exists( self::getMessagesFileName( $code ) ) || file_exists( self::getClassFileName( $code ) ) );
|
||||
}
|
||||
|
||||
static function getLocalisationArray( $code, $disableCache = false ) {
|
||||
self::loadLocalisation( $code, $disableCache );
|
||||
return self::$mLocalisationCache[$code];
|
||||
|
|
|
|||
Loading…
Reference in a new issue