Skip to content

Commit

Permalink
Update BaseHtml.php
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiangirlea authored Aug 17, 2023
1 parent efa357c commit 89600b2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions framework/helpers/BaseHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -1930,13 +1930,12 @@ public static function renderSelectOptions($selection, $items, &$tagOptions = []
if ($selection !== null) {
if (ArrayHelper::isTraversable($selection)) {
$selected = ArrayHelper::isIn((string)$key, $selection, $strict);
} elseif (is_object($selection) && property_exists($selection, 'value')) {
$selected = $selection->value == $key;
} elseif ($key === '' || $selection === '') {
$selected = $selection === $key;
} elseif ($strict) {
$selected = !strcmp((string)$key, (string)$selection);
} else {
$selected = is_object($selection) && property_exists($selection, 'value') ?
$selection->value == $key : $selection == $key;
$selected = $strict ? !strcmp((string)$key, (string)$selection) : $selection == $key;
}
}

Expand Down

0 comments on commit 89600b2

Please sign in to comment.