Skip to content

Commit

Permalink
Fix incorrect check select box value with key that is number.
Browse files Browse the repository at this point in the history
  • Loading branch information
ve3 committed Nov 23, 2023
1 parent 009fac9 commit bd12b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions App/Libraries/RundizSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ private function renderFormSelectbox($field_key, array $fields, array $options_v
$output .= '<optgroup label="'.$option_key.'">'."\n";
foreach ($option_item1 as $option_item2 => $option_item3) {
$output .= '<option value="'.$option_item2.'"';
if (!is_array($field_value) && $field_value === $option_item2) {
if (!is_array($field_value) && strval($field_value) === strval($option_item2)) {
$output .= ' selected="selected"';
} elseif (is_array($field_value) && in_array($option_item2, $field_value)) {
$output .= ' selected="selected"';
Expand All @@ -712,7 +712,7 @@ private function renderFormSelectbox($field_key, array $fields, array $options_v
$output .= '</optgroup>'."\n";
} else {
$output .= '<option value="'.$option_key.'"';
if (!is_array($field_value) && $field_value === $option_key) {
if (!is_array($field_value) && strval($field_value) === strval($option_key)) {
$output .= ' selected="selected"';
} elseif (is_array($field_value) && in_array($option_key, $field_value)) {
$output .= ' selected="selected"';
Expand Down

0 comments on commit bd12b35

Please sign in to comment.