Fixing php4 compatibility and errors from array to string conversion.

This commit is contained in:
Mark Story 2010-01-26 10:55:11 -05:00
parent 16eaa990df
commit 9cbb9d193a

View file

@ -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 {