provide failsafe language in case $sm_language is not set in accept_lang
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 9 May 2005 17:25:56 +0000 (17:25 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 9 May 2005 17:25:56 +0000 (17:25 +0000)
and default language.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9410 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/i18n.php

index e243ce56b730034f6f19d2e96130600fa7c28abf..554ab4427c189a458c62a67b43618ae68b733f5c 100644 (file)
@@ -322,6 +322,10 @@ function set_up_language($sm_language, $do_search = false, $default = false) {
         $squirrelmail_language = $squirrelmail_default_language;
         $sm_language = $squirrelmail_default_language;
     }
+
+    /** provide failsafe language when detection fails */
+    if (! $sm_language) $sm_language='en_US';
+
     $sm_notAlias = $sm_language;
 
     // Catching removed translation