Skip to content

Commit

Permalink
Update BaseHtml.php
Browse files Browse the repository at this point in the history
added extra check: check the object has value property
  • Loading branch information
ionutwho authored Aug 16, 2023
1 parent 5e73f15 commit efa357c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/helpers/BaseHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,8 @@ public static function renderSelectOptions($selection, $items, &$tagOptions = []
} elseif ($strict) {
$selected = !strcmp((string)$key, (string)$selection);
} else {
$selected = is_object($selection) ? $selection->value == $key : $selection == $key;
$selected = is_object($selection) && property_exists($selection, 'value') ?
$selection->value == $key : $selection == $key;
}
}

Expand Down

0 comments on commit efa357c

Please sign in to comment.