diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 62982ee75..a1aaa34fc 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1721,7 +1721,10 @@ class FormHelper extends AppHelper { } if ($name !== null) { - if ((!$selectedIsEmpty && (string)$selected == (string)$name) || ($selectedIsArray && in_array($name, $selected))) { + if ( + (!$selectedIsArray && !$selectedIsEmpty && (string)$selected == (string)$name) || + ($selectedIsArray && in_array($name, $selected)) + ) { if ($attributes['style'] === 'checkbox') { $htmlOptions['checked'] = true; } else {