From 531a52e05323055a36474639b0a53e87bba52f74 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Wed, 1 Apr 2020 20:52:20 +0200 Subject: [PATCH] remove superfluous code in check_language() dd52a98d4392b443f0e14cf41ebe5030315497c7 added honoring POST['lang'] and COOKIE['lang'] even if $_SERVER['HTTP_ACCEPT_LANGUAGE'] is not set. This also means we can drop the now-duplicate check in the code section handling $_SERVER['HTTP_ACCEPT_LANGUAGE']. --- functions.inc.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 5d2d2398..48df3c64 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -182,12 +182,6 @@ function check_language($use_post = true) { // If not, did the browser give us any hint(s)? if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $lang_array = preg_split('/(\s*,\s*)/', $_SERVER['HTTP_ACCEPT_LANGUAGE']); - if (safecookie('lang')) { - array_unshift($lang_array, safecookie('lang')); # prefer language from cookie - } - if ($use_post && safepost('lang')) { - array_unshift($lang_array, safepost('lang')); # but prefer $_POST['lang'] even more - } foreach ($lang_array as $value) { if (!is_string($value)) {