From bc389ff9341d8efec367b2b07c2d1b55be11b8d0 Mon Sep 17 00:00:00 2001 From: Alexandre Hannud Abdo Date: Fri, 23 May 2014 10:16:03 -0300 Subject: Language selection: case-insensitive and system language Fixed ignoring HTTP_ACCEPT_LANGUAGE tags that had uppercase characters. Fixed defining a->language too soon to ever get the system lang --- include/language.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/language.php') diff --git a/include/language.php b/include/language.php index cfaa855dd..855d94505 100644 --- a/include/language.php +++ b/include/language.php @@ -43,8 +43,6 @@ function get_browser_language() { arsort($langs, SORT_NUMERIC); } } - else - $langs['en'] = 1; return $langs; } @@ -65,6 +63,7 @@ function get_best_language() { if(isset($langs) && count($langs)) { foreach ($langs as $lang => $v) { + $lang = strtolower($lang); if(file_exists("view/$lang") && is_dir("view/$lang")) { $preferred = $lang; break; -- cgit v1.2.3