Permalink
Browse files

$this->data[$habtmKey] could be a string, meaning $this->data[$habtmK…

…ey][$habtmKey] would be the first character of that string. Probably not what you want.

Fixes #1549

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information...
1 parent 0e7f2ef commit d0b7d3355d72fbb5046dca83a0f6efae0e7db3c2 @geon geon committed with markstory Feb 21, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 cake/libs/view/helper.php
@@ -708,7 +708,7 @@ function value($options = array(), $field = null, $key = 'value') {
}
$habtmKey = $this->field();
- if (empty($result) && isset($this->data[$habtmKey][$habtmKey])) {
+ if (empty($result) && isset($this->data[$habtmKey][$habtmKey]) && is_array($this->data[$habtmKey])) {
$result = $this->data[$habtmKey][$habtmKey];
} elseif (empty($result) && isset($this->data[$habtmKey]) && is_array($this->data[$habtmKey])) {
if (ClassRegistry::isKeySet($habtmKey)) {

0 comments on commit d0b7d33

Please sign in to comment.