Skip to content
Snippets Groups Projects
Commit 7f0909eb authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #36407 by DriesK: make sure the private key is set.

parent e4325eb0
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,11 @@ function drupal_get_form($form_id, &$form, $callback = NULL) { ...@@ -54,6 +54,11 @@ function drupal_get_form($form_id, &$form, $callback = NULL) {
$form['#type'] = 'form'; $form['#type'] = 'form';
if (isset($form['#token'])) { 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', $form['form_token'] = array('#type' => 'hidden', '#value' => md5($_SERVER['REMOTE_ADDR'] . $form['#token'] . variable_get('drupal_private_key',
''))); '')));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment