mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing sorting of fields used in a form when using the SecurityComponent
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5696 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
0c6cdfb5c9
commit
34a88741bf
2 changed files with 2 additions and 2 deletions
|
@ -524,7 +524,7 @@ class SecurityComponent extends Object {
|
|||
$field[$key] = array_merge($merge, $field[$key]);
|
||||
}
|
||||
}
|
||||
sort($field);
|
||||
ksort($field);
|
||||
$check = urlencode(Security::hash(serialize($field) . CAKE_SESSION_STRING));
|
||||
|
||||
if ($form !== $check) {
|
||||
|
|
|
@ -257,7 +257,7 @@ class FormHelper extends AppHelper {
|
|||
}
|
||||
function secure($fields) {
|
||||
$append = '<p style="display: inline; margin: 0px; padding: 0px;">';
|
||||
sort($fields);
|
||||
ksort($fields);
|
||||
$append .= $this->hidden('_Token.fields', array('value' => urlencode(Security::hash(serialize($fields) . CAKE_SESSION_STRING)), 'id' => 'TokenFields' . mt_rand()));
|
||||
$append .= '</p>';
|
||||
return $append;
|
||||
|
|
Loading…
Reference in a new issue