summaryrefslogtreecommitdiffstats
path: root/include/functions.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2018-05-27 11:52:43 -0700
committerArun Persaud <arun@nubati.net>2018-05-27 11:54:39 -0700
commita83ac7d982fa4f9d49ac3e6dedac8b489f2f7baa (patch)
tree64d795696e93c90c2f34a75f5f39e97b654ac0b1 /include/functions.php
parentef063011a04ce1a62c1f6e0b21be4b2d10e9845e (diff)
downloade-DoKo-a83ac7d982fa4f9d49ac3e6dedac8b489f2f7baa.tar.gz
e-DoKo-a83ac7d982fa4f9d49ac3e6dedac8b489f2f7baa.tar.bz2
e-DoKo-a83ac7d982fa4f9d49ac3e6dedac8b489f2f7baa.zip
fix error when language is not setHEADmaster
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php11
1 files changed, 8 insertions, 3 deletions
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')