Skip to content
This repository was archived by the owner on Aug 14, 2023. It is now read-only.

Commit 50ae7a6

Browse files
committed
Merge branch 'hotfix/drupal-7.71-update'
2 parents 986b689 + b9fbff5 commit 50ae7a6

File tree

167 files changed

+1252
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+1252
-452
lines changed

CHANGELOG.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
Drupal 7.xx, xxxx-xx-xx (development version)
1+
Drupal 7.71, 2020-06-03
22
-----------------------
3+
- Fix for jQuery Form bug in Chromium-based browsers
4+
- Full support for PHP 7.4
5+
6+
Drupal 7.70, 2020-05-19
7+
-----------------------
8+
- Fixed security issues:
9+
- SA-CORE-2020-002
10+
- SA-CORE-2020-003
311

412
Drupal 7.69, 2019-12-18
513
-----------------------

includes/batch.inc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -478,18 +478,17 @@ function _batch_finished() {
478478
$queue->deleteQueue();
479479
}
480480
}
481+
// Clean-up the session. Not needed for CLI updates.
482+
if (isset($_SESSION)) {
483+
unset($_SESSION['batches'][$batch['id']]);
484+
if (empty($_SESSION['batches'])) {
485+
unset($_SESSION['batches']);
486+
}
487+
}
481488
}
482489
$_batch = $batch;
483490
$batch = NULL;
484491

485-
// Clean-up the session. Not needed for CLI updates.
486-
if (isset($_SESSION)) {
487-
unset($_SESSION['batches'][$batch['id']]);
488-
if (empty($_SESSION['batches'])) {
489-
unset($_SESSION['batches']);
490-
}
491-
}
492-
493492
// Redirect if needed.
494493
if ($_batch['progressive']) {
495494
// Revert the 'destination' that was saved in batch_process().

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.69');
11+
define('VERSION', '7.71');
1212

1313
/**
1414
* Core API compatibility.

includes/common.inc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ function drupal_add_feed($url = NULL, $title = '') {
391391
*/
392392
function drupal_get_feeds($delimiter = "\n") {
393393
$feeds = drupal_add_feed();
394-
return implode($feeds, $delimiter);
394+
return implode($delimiter, $feeds);
395395
}
396396

397397
/**
@@ -684,7 +684,10 @@ function drupal_goto($path = '', array $options = array(), $http_response_code =
684684
// We do not allow absolute URLs to be passed via $_GET, as this can be an attack vector.
685685
if (isset($_GET['destination']) && !url_is_external($_GET['destination'])) {
686686
$destination = drupal_parse_url($_GET['destination']);
687-
$path = $destination['path'];
687+
// Double check the path derived by drupal_parse_url() is not external.
688+
if (!url_is_external($destination['path'])) {
689+
$path = $destination['path'];
690+
}
688691
$options['query'] = $destination['query'];
689692
$options['fragment'] = $destination['fragment'];
690693
}
@@ -3740,7 +3743,7 @@ function _drupal_build_css_path($matches, $base = NULL) {
37403743
}
37413744

37423745
// Prefix with base and remove '../' segments where possible.
3743-
$path = $_base . $matches[1];
3746+
$path = $_base . (isset($matches[1]) ? $matches[1] : '');
37443747
$last = '';
37453748
while ($path != $last) {
37463749
$last = $path;
@@ -6653,7 +6656,7 @@ function element_children(&$elements, $sort = FALSE) {
66536656
$children = array();
66546657
$sortable = FALSE;
66556658
foreach ($elements as $key => $value) {
6656-
if ($key === '' || $key[0] !== '#') {
6659+
if (is_int($key) || $key === '' || $key[0] !== '#') {
66576660
$children[$key] = $value;
66586661
if (is_array($value) && isset($value['#weight'])) {
66596662
$sortable = TRUE;

includes/filetransfer/filetransfer.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ abstract class FileTransfer {
301301
$parts = explode('/', $path);
302302
$chroot = '';
303303
while (count($parts)) {
304-
$check = implode($parts, '/');
304+
$check = implode('/', $parts);
305305
if ($this->isFile($check . '/' . drupal_basename(__FILE__))) {
306306
// Remove the trailing slash.
307307
return substr($chroot, 0, -1);

includes/menu.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,6 +2483,9 @@ function menu_link_get_preferred($path = NULL, $selected_menu = NULL) {
24832483
// untranslated paths). Afterwards, the most relevant path is picked from
24842484
// the menus, ordered by menu preference.
24852485
$item = menu_get_item($path);
2486+
if ($item === FALSE) {
2487+
return FALSE;
2488+
}
24862489
$path_candidates = array();
24872490
// 1. The current item href.
24882491
$path_candidates[$item['href']] = $item['href'];

includes/pager.inc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,16 @@ function theme_pager($variables) {
324324
$quantity = empty($variables['quantity']) ? 0 : $variables['quantity'];
325325
global $pager_page_array, $pager_total;
326326

327+
// Nothing to do if there is no pager.
328+
if (!isset($pager_page_array[$element]) || !isset($pager_total[$element])) {
329+
return;
330+
}
331+
332+
// Nothing to do if there is only one page.
333+
if ($pager_total[$element] <= 1) {
334+
return;
335+
}
336+
327337
// Calculate various markers within this pager piece:
328338
// Middle is used to "center" pages around the current page.
329339
$pager_middle = ceil($quantity / 2);
@@ -455,6 +465,11 @@ function theme_pager_first($variables) {
455465
global $pager_page_array;
456466
$output = '';
457467

468+
// Nothing to do if there is no pager.
469+
if (!isset($pager_page_array[$element])) {
470+
return;
471+
}
472+
458473
// If we are anywhere but the first page
459474
if ($pager_page_array[$element] > 0) {
460475
$output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array(0, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters));
@@ -485,6 +500,11 @@ function theme_pager_previous($variables) {
485500
global $pager_page_array;
486501
$output = '';
487502

503+
// Nothing to do if there is no pager.
504+
if (!isset($pager_page_array[$element])) {
505+
return;
506+
}
507+
488508
// If we are anywhere but the first page
489509
if ($pager_page_array[$element] > 0) {
490510
$page_new = pager_load_array($pager_page_array[$element] - $interval, $element, $pager_page_array);
@@ -524,6 +544,11 @@ function theme_pager_next($variables) {
524544
global $pager_page_array, $pager_total;
525545
$output = '';
526546

547+
// Nothing to do if there is no pager.
548+
if (!isset($pager_page_array[$element]) || !isset($pager_total[$element])) {
549+
return;
550+
}
551+
527552
// If we are anywhere but the last page
528553
if ($pager_page_array[$element] < ($pager_total[$element] - 1)) {
529554
$page_new = pager_load_array($pager_page_array[$element] + $interval, $element, $pager_page_array);
@@ -560,6 +585,11 @@ function theme_pager_last($variables) {
560585
global $pager_page_array, $pager_total;
561586
$output = '';
562587

588+
// Nothing to do if there is no pager.
589+
if (!isset($pager_page_array[$element]) || !isset($pager_total[$element])) {
590+
return;
591+
}
592+
563593
// If we are anywhere but the last page
564594
if ($pager_page_array[$element] < ($pager_total[$element] - 1)) {
565595
$output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array($pager_total[$element] - 1, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters));

includes/path.inc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,15 @@ function path_delete($criteria) {
466466
$criteria = array('pid' => $criteria);
467467
}
468468
$path = path_load($criteria);
469-
$query = db_delete('url_alias');
470-
foreach ($criteria as $field => $value) {
471-
$query->condition($field, $value);
469+
if (isset($path['source'])) {
470+
$query = db_delete('url_alias');
471+
foreach ($criteria as $field => $value) {
472+
$query->condition($field, $value);
473+
}
474+
$query->execute();
475+
module_invoke_all('path_delete', $path);
476+
drupal_clear_path_cache($path['source']);
472477
}
473-
$query->execute();
474-
module_invoke_all('path_delete', $path);
475-
drupal_clear_path_cache($path['source']);
476478
}
477479

478480
/**

includes/request-sanitizer.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class DrupalRequestSanitizer {
9999
protected static function stripDangerousValues($input, array $whitelist, array &$sanitized_keys) {
100100
if (is_array($input)) {
101101
foreach ($input as $key => $value) {
102-
if ($key !== '' && $key[0] === '#' && !in_array($key, $whitelist, TRUE)) {
102+
if ($key !== '' && is_string($key) && $key[0] === '#' && !in_array($key, $whitelist, TRUE)) {
103103
unset($input[$key]);
104104
$sanitized_keys[] = $key;
105105
}

misc/ajax.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,25 @@ Drupal.ajax = function (base, element, element_settings) {
198198
type: 'POST'
199199
};
200200

201+
// For multipart forms (e.g., file uploads), jQuery Form targets the form
202+
// submission to an iframe instead of using an XHR object. The initial "src"
203+
// of the iframe, prior to the form submission, is set to options.iframeSrc.
204+
// "about:blank" is the semantically correct, standards-compliant, way to
205+
// initialize a blank iframe; however, some old IE versions (possibly only 6)
206+
// incorrectly report a mixed content warning when iframes with an
207+
// "about:blank" src are added to a parent document with an https:// origin.
208+
// jQuery Form works around this by defaulting to "javascript:false" instead,
209+
// but that breaks on Chrome 83, so here we force the semantically correct
210+
// behavior for all browsers except old IE.
211+
// @see https://www.drupal.org/project/drupal/issues/3143016
212+
// @see https://github.com/jquery-form/form/blob/df9cb101b9c9c085c8d75ad980c7ff1cf62063a1/jquery.form.js#L68
213+
// @see https://bugs.chromium.org/p/chromium/issues/detail?id=1084874
214+
// @see https://html.spec.whatwg.org/multipage/browsers.html#creating-browsing-contexts
215+
// @see https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
216+
if (navigator.userAgent.indexOf("MSIE") === -1) {
217+
ajax.options.iframeSrc = 'about:blank';
218+
}
219+
201220
// Bind the ajaxSubmit function to the element event.
202221
$(ajax.element).bind(element_settings.event, function (event) {
203222
if (!Drupal.settings.urlIsAjaxTrusted[ajax.url] && !Drupal.urlIsLocal(ajax.url)) {

0 commit comments

Comments
 (0)