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

- Patch by chx: made form tokens work.

parent b8832d76
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -68,9 +68,9 @@ function drupal_get_form($form_id, &$form, $callback = NULL) { ...@@ -68,9 +68,9 @@ function drupal_get_form($form_id, &$form, $callback = NULL) {
variable_set('drupal_private_key', mt_rand()); variable_set('drupal_private_key', mt_rand());
} }
$form['form_token'] = array('#type' => 'hidden', '#value' => md5(session_id() . $form['#token'] . variable_get('drupal_private_key', ''))); $form['form_token'] = array('#type' => 'hidden', '#default_value' => md5(session_id() . $form['#token'] . variable_get('drupal_private_key', '')));
} }
$form['form_id'] = array('#type' => 'hidden', '#default_value' => $form_id); $form['form_id'] = array('#type' => 'hidden', '#value' => $form_id);
$form = array_merge(_element_info('form'), $form); $form = array_merge(_element_info('form'), $form);
......
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