From 240f4ceabd0220edcd23d527ff267b9dd8492244 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 3 Sep 2020 18:21:38 -0400 Subject: [PATCH] Fix code warning if no value is selected in htmlSelect --- web/includes/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index a6f6521df..54d189631 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -520,8 +520,9 @@ function htmlOptions($options, $values) { } else { $text = $option; } - $selected = is_array($values) ? in_array($value, $values) : !strcmp($value, $values); - $has_selected = (!$has_selected) && $selected; + $selected = is_array($values) ? in_array($value, $values) : (!strcmp($value, $values)); + if ( !$has_selected ) + $has_selected = $selected; $options_html .= '