Fix spelling in setting language cookie

See #6
This commit is contained in:
jrenslin committed 2021-05-13 15:21:06 +02:00
1 parent d03befe483
commit 63d6154d40
1 file changed
+4 -4
+4 -4
View File
@@ -354,17 +354,17 @@ public static function get_user_lang(array $allowed_langs, string $default_lang)
];
if (isset($_GET['navlang']) and in_array($_GET['navlang'], $allowed_langs, true)) {
if (!(setcookie('__HOST-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['__HOST-lang']) and in_array($_COOKIE['__HOST-lang'], $allowed_langs, true)) {
$lang = $_COOKIE['__HOST-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('__HOST-lang', $lang, $cookie_options))) {
if (!(setcookie('__Host-lang', $lang, $cookie_options))) {
throw new Exception("Failed to set language");
}
}