mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
7982208113
commit
874f06a165
1 changed files with 12 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue