Skip to content

Commit

Permalink
Ensure keys are strings before accessing them.
Browse files Browse the repository at this point in the history
Some userland datasources (namely an oracle driver) manage to get arrays
into $stack.

Refs #8281
  • Loading branch information
markstory committed Feb 19, 2016
1 parent 68082fa commit 7a59070
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DataSource.php
Expand Up @@ -368,7 +368,7 @@ public function insertQueryData($query, $data, $association, Model $Model, $stac
} 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;
Expand Down

0 comments on commit 7a59070

Please sign in to comment.