]> git.p6c8.net - jirafeau_mojo42.git/commitdiff
lib/template/header.php: fix Undefined index: HTTP_ACCEPT
authorJerome Jutteau <mojo@couak.net>
Mon, 12 Oct 2015 17:20:21 +0000 (19:20 +0200)
committerJerome Jutteau <mojo@couak.net>
Mon, 12 Oct 2015 17:20:21 +0000 (19:20 +0200)
Signed-off-by: Jerome Jutteau <mojo@couak.net>
lib/lang.php

index da28a81b1d70b911766190d2d7d318033cc8f9f9..79e32d2fc7f4908528f9e7b8498a884992f9c856 100644 (file)
@@ -80,7 +80,12 @@ function json_lang_generator ()
 \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