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:
phpnut 2007-09-27 00:38:03 +00:00
parent 0c6cdfb5c9
commit 34a88741bf
2 changed files with 2 additions and 2 deletions

View file

@ -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) {

View file

@ -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;