From 7a5907057abf94732817938e00fdddc7725ad93f Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 18 Feb 2016 21:03:57 -0500 Subject: [PATCH] Ensure keys are strings before accessing them. Some userland datasources (namely an oracle driver) manage to get arrays into $stack. Refs #8281 --- lib/Cake/Model/Datasource/DataSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/DataSource.php b/lib/Cake/Model/Datasource/DataSource.php index e77df4f8e..37e1e0f14 100644 --- a/lib/Cake/Model/Datasource/DataSource.php +++ b/lib/Cake/Model/Datasource/DataSource.php @@ -368,7 +368,7 @@ class DataSource extends Object { } else { $found = false; foreach (array_reverse($stack) as $assocData) { - if (isset($data[$assocData]) && isset($data[$assocData][$insertKey])) { + if (is_string($assocData) && isset($data[$assocData]) && isset($data[$assocData][$insertKey])) { $val = $data[$assocData][$insertKey]; $found = true; break;