mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
$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:
parent
0e7f2efdb1
commit
d0b7d3355d
1 changed files with 1 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue