Adding fix for forms that pass an empty value for a hidden field

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4976 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-05-01 17:42:09 +00:00
parent 7982208113
commit 874f06a165

View file

@ -458,7 +458,18 @@ class SecurityComponent extends Object {
$newKey = substr($key, 1);
$controller->data[$newKey] = Set::pushDiff($controller->data[$key], $controller->data[$newKey]);
unset($controller->data[$key]);
$field[$key] = $value;
if(is_array($value)) {
$values = array_values($value);
if(isset($values['0']) && empty($values['0'])) {
$k = array_keys($value);
if(isset($values['0'])) {
$field[$key][$k['0']] = null;
}
} else {
$field[$key] = $value;
}
}
continue;
}
$field[$key] = array_keys($value);