From a83ac7d982fa4f9d49ac3e6dedac8b489f2f7baa Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 27 May 2018 11:52:43 -0700 Subject: fix error when language is not set --- include/functions.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index f3495a4..ee02b0a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1715,9 +1715,14 @@ function verify_password($email, $password) function detectlanguage() { /* read out browser's prefered language, taken from php-manual*/ - $langcode = explode(";", $_SERVER['HTTP_ACCEPT_LANGUAGE']); - $langcode = explode(",", $langcode['0']); - return $langcode['0']; + if(isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) + { + $langcode = explode(";", $_SERVER['HTTP_ACCEPT_LANGUAGE']); + $langcode = explode(",", $langcode['0']); + return $langcode['0']; + } + else + return 'en'; } function set_language($l,$type='lang') -- cgit v1.2.3-18-g5258