remove superfluous code in check_language()

dd52a98d43 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'].
feature-php-crypt-prefix
Christian Boltz 4 years ago
parent 4d10a2c4bb
commit 531a52e053
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C

@ -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)) {

Loading…
Cancel
Save