mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Fixes #5016, Security->disabledFields not working properly. Empty value arrays needed to be unset
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7314 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
6ee4849172
commit
30a49a39e4
2 changed files with 8 additions and 1 deletions
|
@ -565,14 +565,21 @@ class SecurityComponent extends Object {
|
|||
if (in_array($value, $key)) {
|
||||
$remove = explode('.', $value);
|
||||
unset($check[$remove['0']][$remove['1']]);
|
||||
if (empty($check[$remove['0']])) {
|
||||
unset($check[$remove['0']]);
|
||||
}
|
||||
} elseif (in_array('_' . $value, $key)) {
|
||||
$remove = explode('.', $value);
|
||||
$controller->data[$remove['0']][$remove['1']] = $controller->data['_' . $remove['0']][$remove['1']];
|
||||
unset($check['_' . $remove['0']][$remove['1']]);
|
||||
if (empty($check['_' . $remove['0']])) {
|
||||
unset($check['_' . $remove['0']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ksort($check);
|
||||
|
||||
foreach ($check as $key => $value) {
|
||||
$merge = array();
|
||||
if ($key === '__Token') {
|
||||
|
|
Loading…
Add table
Reference in a new issue