diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index e08a5b48b..635d2f1d2 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -561,17 +561,17 @@ class SecurityComponent extends Object { $merge[] = $lookup; } } - } - if (!is_numeric($k[0])) { - if (isset($field[$newKey])) { - $field[$newKey] = array_merge($merge, $field[$newKey]); - } else { - $field[$newKey] = $merge; + if (!is_numeric($k[0])) { + if (isset($field[$newKey])) { + $field[$newKey] = array_merge($merge, $field[$newKey]); + } else { + $field[$newKey] = $merge; + } + $controller->data[$newKey] = Set::pushDiff($controller->data[$key], $controller->data[$newKey]); } - $controller->data[$newKey] = Set::pushDiff($controller->data[$key], $controller->data[$newKey]); + unset($controller->data[$key]); } - unset($controller->data[$key]); continue; } $keys = array_keys($value);