Skip to content

Commit

Permalink
Partially revert 'Fix improper implementation of strict checks'
Browse files Browse the repository at this point in the history
  • Loading branch information
adnandautovic committed Apr 7, 2022
1 parent 8249a88 commit e935943
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/helpers/BaseHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ public static function checkboxList($name, $selection = null, $items = [], $opti
foreach ($items as $value => $label) {
$checked = $selection !== null &&
(!ArrayHelper::isTraversable($selection) && !strcmp($value, $selection)
|| ArrayHelper::isTraversable($selection) && ArrayHelper::isIn($value, $selection, $strict));
|| ArrayHelper::isTraversable($selection) && ArrayHelper::isIn((string)$value, $selection, $strict));
if ($formatter !== null) {
$lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value);
} else {
Expand Down Expand Up @@ -1084,7 +1084,7 @@ public static function radioList($name, $selection = null, $items = [], $options
foreach ($items as $value => $label) {
$checked = $selection !== null &&
(!ArrayHelper::isTraversable($selection) && !strcmp($value, $selection)
|| ArrayHelper::isTraversable($selection) && ArrayHelper::isIn($value, $selection, $strict));
|| ArrayHelper::isTraversable($selection) && ArrayHelper::isIn((string)$value, $selection, $strict));
if ($formatter !== null) {
$lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value);
} else {
Expand Down

0 comments on commit e935943

Please sign in to comment.