Skip to content

Commit 2cd8edb

Browse files
author
Pantheon Automation
committed
Update to Drupal 7.72. For more information, see https://www.drupal.org/project/drupal/releases/7.72
1 parent ce4482f commit 2cd8edb

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Drupal 7.72, 2020-06-17
2+
-----------------------
3+
- Fixed security issues:
4+
- SA-CORE-2020-004
5+
16
Drupal 7.71, 2020-06-03
27
-----------------------
38
- Fix for jQuery Form bug in Chromium-based browsers

includes/bootstrap.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* The current system version.
1010
*/
11-
define('VERSION', '7.71');
11+
define('VERSION', '7.72');
1212

1313
/**
1414
* Core API compatibility.

includes/form.inc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,12 +1135,8 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
11351135
* Helper function to call form_set_error() if there is a token error.
11361136
*/
11371137
function _drupal_invalid_token_set_form_error() {
1138-
$path = current_path();
1139-
$query = drupal_get_query_parameters();
1140-
$url = url($path, array('query' => $query));
1141-
11421138
// Setting this error will cause the form to fail validation.
1143-
form_set_error('form_token', t('The form has become outdated. Copy any unsaved work in the form below and then <a href="@link">reload this page</a>.', array('@link' => $url)));
1139+
form_set_error('form_token', t('The form has become outdated. Press the back button, copy any unsaved work in the form, and then reload the page.'));
11441140
}
11451141

11461142
/**
@@ -1181,6 +1177,11 @@ function drupal_validate_form($form_id, &$form, &$form_state) {
11811177
if (!empty($form['#token'])) {
11821178
if (!drupal_valid_token($form_state['values']['form_token'], $form['#token']) || !empty($form_state['invalid_token'])) {
11831179
_drupal_invalid_token_set_form_error();
1180+
// Ignore all submitted values.
1181+
$form_state['input'] = array();
1182+
$_POST = array();
1183+
// Make sure file uploads do not get processed.
1184+
$_FILES = array();
11841185
// Stop here and don't run any further validation handlers, because they
11851186
// could invoke non-safe operations which opens the door for CSRF
11861187
// vulnerabilities.
@@ -1848,6 +1849,9 @@ function form_builder($form_id, &$element, &$form_state) {
18481849
_drupal_invalid_token_set_form_error();
18491850
// This value is checked in _form_builder_handle_input_element().
18501851
$form_state['invalid_token'] = TRUE;
1852+
// Ignore all submitted values.
1853+
$form_state['input'] = array();
1854+
$_POST = array();
18511855
// Make sure file uploads do not get processed.
18521856
$_FILES = array();
18531857
}

modules/file/tests/file.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ class FileManagedFileElementTestCase extends FileFieldTestCase {
409409
'form_token' => 'invalid token',
410410
);
411411
$this->drupalPost($path, $edit, t('Save'));
412-
$this->assertText('The form has become outdated. Copy any unsaved work in the form below');
412+
$this->assertText('The form has become outdated.');
413413
$last_fid = $this->getLastFileId();
414414
$this->assertEqual($last_fid_prior, $last_fid, 'File was not saved when uploaded with an invalid form token.');
415415

modules/simpletest/tests/form.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ class FormsTestCase extends DrupalWebTestCase {
521521
$form_state['values'] = array();
522522
drupal_prepare_form($form_id, $form, $form_state);
523523

524+
// Set the CSRF token in the user-provided input.
525+
$form_state['input']['form_token'] = $form['form_token']['#default_value'];
526+
524527
// This is the main function we want to test: it is responsible for
525528
// populating user supplied $form_state['input'] to sanitized
526529
// $form_state['values'].
@@ -687,7 +690,7 @@ class FormValidationTestCase extends DrupalWebTestCase {
687690
$this->drupalPost(NULL, $edit, 'Save');
688691
$this->assertNoFieldByName('name', '#value changed by #validate', 'Form element #value was not altered.');
689692
$this->assertNoText('Name value: value changed by form_set_value() in #validate', 'Form element value in $form_state was not altered.');
690-
$this->assertText('The form has become outdated. Copy any unsaved work in the form below');
693+
$this->assertText('The form has become outdated.');
691694
}
692695

693696
/**

0 commit comments

Comments
 (0)