$this->data[$habtmKey] could be a string, meaning $this->data[$habtmKey][$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>
This commit is contained in:
Victor Widell 2011-02-21 04:38:07 -08:00 committed by mark_story
parent 0e7f2efdb1
commit d0b7d3355d

View file

@ -708,7 +708,7 @@ class Helper extends Overloadable {
}
$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)) {