fixing possible notices in SecurityComponent::__validatePost, closes #5232

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7545 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
DarkAngelBGE 2008-09-02 04:04:49 +00:00
parent 55361320d4
commit 2deb6f3828

View file

@ -604,7 +604,7 @@ class SecurityComponent extends Object {
$k = array_keys($value);
$count = count($k);
if (is_numeric($k[0])) {
if ($count > 0 && is_numeric($k[0])) {
for ($i = 0; $count > $i; $i++) {
foreach ($values[$i] as $key2 => $value1) {
if ($value1 === '0' && !in_array($key2, $field[$newKey][$i])) {
@ -627,7 +627,7 @@ class SecurityComponent extends Object {
}
}
if (!is_numeric($k[0])) {
if ($count == 0 || !is_numeric($k[0])) {
if (isset($field[$newKey])) {
$field[$newKey] = array_merge($merge, $field[$newKey]);
} else {