mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56: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') {
|
||||
|
|
|
@ -444,7 +444,7 @@ class FormHelper extends AppHelper {
|
|||
*
|
||||
* @param string $fieldName This should be "Modelname.fieldname", "Modelname/fieldname" is deprecated
|
||||
* @param string $text Text that will appear in the label field.
|
||||
* @param array $attributes Array of HTML attributes.
|
||||
* @param array $attributes Array of HTML attributes.
|
||||
* @return string The formatted LABEL element
|
||||
*/
|
||||
function label($fieldName = null, $text = null, $attributes = array()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue