Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
3a84ed2a
Commit
3a84ed2a
authored
Apr 02, 2006
by
Gerhard Killesreiter
Browse files
#56921
, break up references in _validate, patch by chx
parent
767ed120
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/form.inc
View file @
3a84ed2a
...
...
@@ -157,6 +157,15 @@ function drupal_get_form($form_id, &$form, $callback = NULL) {
function
drupal_validate_form
(
$form_id
,
&
$form
,
$callback
=
NULL
)
{
global
$form_values
;
// we need a copy of form_values otherwise foreach falls into an infite loop
$copy
=
(
array
)
$form_values
;
// this loop breaks the references in form_values thus makes it impossible for
// validate functions to modify the $form_values array
foreach
(
$copy
as
$k
=>
$v
)
{
unset
(
$form_values
[
$k
]);
$form_values
[
$k
]
=
$v
;
}
if
(
isset
(
$form
[
'#token'
]))
{
if
(
$form_values
[
'form_token'
]
!=
md5
(
session_id
()
.
$form
[
'#token'
]
.
variable_get
(
'drupal_private_key'
,
''
)))
{
// setting this error will cause the form to fail validation
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment