From 07079fc2394d90788e76ce6d080894cc4b3f70fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jul 2024 19:32:02 +0200 Subject: [PATCH] Fix bad position of selected option --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 023982e6a7b..f32c0f4119f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8707,7 +8707,7 @@ class Form } } else { $id = (string) $id; // if $id = 0, then $id = '0' - if ($id != '' && ($id == $key || ($id == 'ifone' && count($array) == 1)) && !$disabled) { + if ($id != '' && (($id == (string) $key) || ($id == 'ifone' && count($array) == 1)) && !$disabled) { $out .= ' selected'; // To preselect a value } }