Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
7f0909eb
Commit
7f0909eb
authored
Nov 06, 2005
by
Dries Buytaert
Browse files
- Patch
#36407
by DriesK: make sure the private key is set.
parent
e4325eb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/form.inc
View file @
7f0909eb
...
...
@@ -54,6 +54,11 @@ function drupal_get_form($form_id, &$form, $callback = NULL) {
$form
[
'#type'
]
=
'form'
;
if
(
isset
(
$form
[
'#token'
]))
{
// Make sure that a private key is set:
if
(
!
variable_get
(
'drupal_private_key'
,
''
))
{
variable_set
(
'drupal_private_key'
,
mt_rand
());
}
$form
[
'form_token'
]
=
array
(
'#type'
=>
'hidden'
,
'#value'
=>
md5
(
$_SERVER
[
'REMOTE_ADDR'
]
.
$form
[
'#token'
]
.
variable_get
(
'drupal_private_key'
,
''
)));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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