From d0b7d3355d72fbb5046dca83a0f6efae0e7db3c2 Mon Sep 17 00:00:00 2001 From: Victor Widell Date: Mon, 21 Feb 2011 04:38:07 -0800 Subject: [PATCH] $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 --- cake/libs/view/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index ecd731b90..b8bc471fe 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -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)) {