Permalink
Browse files

Use + instead of array_merge.

If you have numeric columns in your database, array_merge() will re-key
the array dropping the original values.

Fixes #2198
  • Loading branch information...
markstory committed Oct 25, 2013
1 parent 8a90cbd commit 7624884240f53622961e74895cde9daae9ce4d26
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Model/ModelValidator.php
@@ -141,7 +141,7 @@ public function validateAssociated(&$data, $options = array()) {
if (!empty($options['deep']) && isset($data[$model->alias])) {
$recordData = $data[$model->alias];
unset($data[$model->alias]);
- $data = array_merge($data, $recordData);
+ $data += $recordData;
}
$associations = $model->getAssociated();

0 comments on commit 7624884

Please sign in to comment.