From: Brian Wolff Date: Sat, 21 Dec 2013 23:28:25 +0000 (-0700) Subject: Make Language::fetchLanguageName lowercase its first argument. X-Git-Tag: 1.31.0-rc.0~17541^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=dcc32e8ada882ce6adcd5d60b3f8c92d586a357e;p=lhc%2Fweb%2Fwiklou.git Make Language::fetchLanguageName lowercase its first argument. Currently Language::fetchLanguageName( 'en-GB' ) returns false as it expects 'en-gb'. Given that technically speaking, 'en-GB' is the canonical form, I don't think this is a good thing. Changed function to lowercase its argument. There's no Language object handy, so I just used strtolower (since language codes are always ascii, that shouldn't matter) Change-Id: Iba1f581bf2d6d2b26a14f9f80699d8eeb5d724d6 --- diff --git a/languages/Language.php b/languages/Language.php index 0026fdf4bf..23506e9667 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -929,6 +929,7 @@ class Language { * @since 1.20 */ public static function fetchLanguageName( $code, $inLanguage = null, $include = 'all' ) { + $code = strtolower( $code ); $array = self::fetchLanguageNames( $inLanguage, $include ); return !array_key_exists( $code, $array ) ? '' : $array[$code]; }