Skip to content

Commit

Permalink
Fixing php4 compatibility and errors from array to string conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 26, 2010
1 parent 16eaa99 commit 9cbb9d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cake/libs/view/helpers/form.php
Expand Up @@ -1721,7 +1721,10 @@ function __selectOptions($elements = array(), $selected = null, $parents = array
}

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 {
Expand Down

0 comments on commit 9cbb9d1

Please sign in to comment.