Skip to content

Commit

Permalink
Safeguard against bad developer input.
Browse files Browse the repository at this point in the history
Don't try to recurse into associations that may not be defined.
  • Loading branch information
markstory committed Dec 13, 2013
1 parent 54e9606 commit c32a1d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cake/ORM/Marshaller.php
Expand Up @@ -66,8 +66,11 @@ public function one(array $data, $include = []) {

$entity = new $entityClass();
foreach ($data as $key => $value) {
$assoc = null;
if (array_key_exists($key, $include)) {
$assoc = $this->_table->association($key);
}
if ($assoc) {
$value = $this->_marshalAssociation($assoc, $value, $include[$key]);
$entity->set($assoc->property(), $value);
} else {
Expand Down

0 comments on commit c32a1d1

Please sign in to comment.