Use prefixed cookies for user language
This commit is contained in:
parent
fe0a8ba83b
commit
d03befe483
@ -354,17 +354,17 @@ final class MD_STD {
|
||||
];
|
||||
|
||||
if (isset($_GET['navlang']) and in_array($_GET['navlang'], $allowed_langs, true)) {
|
||||
if (!(setcookie('lang', $_GET['navlang'], $cookie_options))) {
|
||||
if (!(setcookie('__HOST-lang', $_GET['navlang'], $cookie_options))) {
|
||||
throw new Exception("Failed to set language");
|
||||
}
|
||||
$lang = $_GET['navlang'];
|
||||
}
|
||||
else if (isset($_COOKIE['lang']) and in_array($_COOKIE['lang'], $allowed_langs, true)) {
|
||||
$lang = $_COOKIE['lang'];
|
||||
else if (isset($_COOKIE['__HOST-lang']) and in_array($_COOKIE['__HOST-lang'], $allowed_langs, true)) {
|
||||
$lang = $_COOKIE['__HOST-lang'];
|
||||
}
|
||||
else {
|
||||
$lang = self::lang_getfrombrowser($allowed_langs, $default_lang, "", false);
|
||||
if (!(setcookie('lang', $lang, $cookie_options))) {
|
||||
if (!(setcookie('__HOST-lang', $lang, $cookie_options))) {
|
||||
throw new Exception("Failed to set language");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user