]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fixes #503: check that HTTP_ACCEPT_LANGUAGE is set before calling autoLocale() 504/head
authorArthurHoaro <arthur@hoa.ro>
Sun, 28 Feb 2016 14:53:28 +0000 (15:53 +0100)
committerArthurHoaro <arthur@hoa.ro>
Sun, 28 Feb 2016 14:53:28 +0000 (15:53 +0100)
index.php

index d1acb8af2baf407dd32941fb1fe42ff026cad128..c65a780cedcf19d82eb5f4f3be569cb194d9a09c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -268,7 +268,10 @@ $GLOBALS['redirector'] = !empty($GLOBALS['redirector']) ? escape($GLOBALS['redir
 // a token depending of deployment salt, user password, and the current ip
 define('STAY_SIGNED_IN_TOKEN', sha1($GLOBALS['hash'].$_SERVER["REMOTE_ADDR"].$GLOBALS['salt']));
 
-autoLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']); // Sniff browser language and set date format accordingly.
+// Sniff browser language and set date format accordingly.
+if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+    autoLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']);
+}
 header('Content-Type: text/html; charset=utf-8'); // We use UTF-8 for proper international characters handling.
 
 //==================================================================================================