Commit ff1b4821 authored by Elliott Eggleston's avatar Elliott Eggleston

Guard against undef $_SERVER['HTTP_ACCEPT_LANGUAGE']

parent f1035cce
......@@ -36,7 +36,7 @@ if (isset($_GET['lang'])) {
setcookie('lang', $_GET['lang'] . '.UTF-8', time() + 31536000, '/');
} else if (isset($_COOKIE['lang'])) {
$languages = array($_COOKIE['lang']);
} else {
} else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
// Attempt to mangle browser language strings in to valid gettext locales (needs a big lookup table to be 100% accurate)
$languages = preg_split('/,/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
for ($i = 0; $i < count($languages); $i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment