From fac96a137623f95bf670badd0a46fd1dd656fa24 Mon Sep 17 00:00:00 2001 From: Shinjiman Date: Sat, 13 Sep 2008 08:07:55 +0000 Subject: [PATCH] * Fixed the HTTP accept language string detection length in LanguageConverter.php, instead of the fixed length language codes. patch by PhiLiP --- RELEASE-NOTES | 2 ++ languages/LanguageConverter.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c68068aa1e..a020edc958 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -197,6 +197,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 15544) Wiki not set up message (NoLocalSettings.php) now works for non-index.php entry pages (e.g. api.php). Patch by Matt Johnston. * (bug 12284) Special:Preferences now sets a returnto parameter on the link to Special:Userlogin. Patch by Marooned. +* Fixed the HTTP accept language string detection length in + LanguageConverter.php, instead of the fixed length language codes. === API changes in 1.14 === diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 1c3926c711..dd69e8267c 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -180,7 +180,8 @@ class LanguageConverter { $header = str_replace( '_', '-', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])); $zh = strstr($header, $pv.'-'); if($zh) { - $pv = substr($zh,0,5); + $ary = split("[,;]",$zh); + $pv = $ary[0]; } } // don't try to return bad variant -- 2.20.1