mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Strict in_array for mixed id variable types
Setting the in_array check to strict, as this would return true incorrectly when and if values are of mixed type.
This commit is contained in:
parent
689745d705
commit
84b10ba707
1 changed files with 1 additions and 1 deletions
|
@ -2471,7 +2471,7 @@ class FormHelper extends AppHelper {
|
|||
if ($name !== null) {
|
||||
if (
|
||||
(!$selectedIsArray && !$selectedIsEmpty && (string)$attributes['value'] == (string)$name) ||
|
||||
($selectedIsArray && in_array($name, $attributes['value']))
|
||||
($selectedIsArray && in_array($name, $attributes['value'], true))
|
||||
) {
|
||||
if ($attributes['style'] === 'checkbox') {
|
||||
$htmlOptions['checked'] = true;
|
||||
|
|
Loading…
Reference in a new issue