]> git.p6c8.net - jirafeau.git/commitdiff
lib/lang.php: fix HTTP_ACCEPT_LANGUAGE not found
authorJerome Jutteau <mojo@couak.net>
Sun, 11 Oct 2015 10:43:06 +0000 (12:43 +0200)
committerJerome Jutteau <mojo@couak.net>
Sun, 11 Oct 2015 10:43:06 +0000 (12:43 +0200)
Signed-off-by: Jerome Jutteau <mojo@couak.net>
lib/lang.php

index 4502f5aa50f5325a2bdfbf5fd6e984b7cf102e17..da28a81b1d70b911766190d2d7d318033cc8f9f9 100644 (file)
@@ -37,7 +37,12 @@ function t ($text)
 \r
     /* Detect user's langage if we are in automatic mode. */\r
     if (strcmp ($cfg['lang'], 'auto') == 0)\r
-        $l = substr ($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r
+    {\r
+        if (isset ($_SERVER['HTTP_ACCEPT_LANGUAGE']))\r
+            $l = substr ($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r
+        else\r
+            $l = "en";\r
+    }\r
     else\r
         $l = $cfg['lang'];\r
 \r

patrick-canterino.de