From df9b337a571dabf74c7d476639d92e1575df6956 Mon Sep 17 00:00:00 2001 From: Je2fb <46494485+Je2fb@users.noreply.github.com> Date: Mon, 13 Dec 2021 09:44:00 +0100 Subject: [PATCH] Fix #19418 --- htdocs/core/class/html.formadmin.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 4196fb32b68..bab9ab61b57 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -75,7 +75,7 @@ class FormAdmin // If the language to select is not inside the list of available language and empty value is not available, we must find // an alternative as the language code to pre-select (to avoid to have first element in list pre-selected). - if ($selected && !in_array($selected, $langs_available) && empty($showempty)) { + if ($selected && !isset($langs_available[$selected]) && empty($showempty)) { $tmparray = explode('_', $selected); if (!empty($tmparray[1])) { $selected = getLanguageCodeFromCountryCode($tmparray[1]);