From bbd86792350ff119dabd81def7a614d43f7a590a Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 23 May 2023 13:39:40 +0200 Subject: [PATCH] #11149 Fix conditional when selected is string and value is integer --- pandora_console/include/functions_html.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 91d4cd734e..55f444771a 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -903,6 +903,11 @@ function html_print_select( ) { // This fixes string ($value) to int ($selected) comparisons $output .= ' selected="selected"'; + } else if (is_numeric($value) && is_string($selected)) { + $str_value = strval($value); + if ($str_value === $selected) { + $output .= ' selected="selected"'; + } } else if ($value === $selected) { // Needs type comparison otherwise if $selected = 0 and $value = "string" this would evaluate to true $output .= ' selected="selected"'; @@ -2155,6 +2160,7 @@ function html_print_extended_select_for_time( } ob_start(); + hd($fields, true); // Use the no_meta parameter because this image is only in the base console. echo '
'; html_print_select(