From 348e31530a1d56a4c914cbf56715c42397babce4 Mon Sep 17 00:00:00 2001 From: phpnut Date: Tue, 9 Oct 2007 18:47:32 +0000 Subject: [PATCH] Fixing blackHole when form has more than one model with check boxes git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5742 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/components/security.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index d40f50fd0..cb28b6c72 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -484,8 +484,8 @@ class SecurityComponent extends Object { } } } - $merge = array(); foreach ($check as $key => $value) { + $merge = array(); if ($key === '__Token') { $field[$key] = $value; continue; @@ -515,8 +515,11 @@ class SecurityComponent extends Object { $merge[] = $lookup; } } + 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]); unset($controller->data[$key]); @@ -601,4 +604,4 @@ class SecurityComponent extends Object { } } } -?> +?> \ No newline at end of file