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

Commit 0a93dbb

Browse files
committed
SERV-294: Updated webform and core
1 parent 799d445 commit 0a93dbb

File tree

157 files changed

+843
-546
lines changed

Some content is hidden

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

157 files changed

+843
-546
lines changed

.htaccess

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
# Protect files and directories from prying eyes.
6-
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
6+
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
77
<IfModule mod_authz_core.c>
88
Require all denied
99
</IfModule>

CHANGELOG.txt

+24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
Drupal 7.xx, xxxx-xx-xx (development version)
22
-----------------------
33

4+
Drupal 7.69, 2019-12-18
5+
-----------------------
6+
- Fixed security issues:
7+
- SA-CORE-2019-012
8+
9+
Drupal 7.68, 2019-12-04
10+
-----------------------
11+
- Fixed: Hide toolbar when printing
12+
- Fixed: Settings returned via ajax are not run through hook_js_alter()
13+
- Fixed: Use drupal_http_build_query() in drupal_http_request()
14+
- Fixed: DrupalRequestSanitizer not found fatal error when bootstrap phase order is changed
15+
- Fixed: Block web.config in .htaccess (and vice-versa)
16+
- Fixed: Create "scripts" element to align rendering workflow to how "styles" are handled
17+
- PHP 7.3: Fixed 'Cannot change session id when session is active'
18+
- PHP 7.1: Fixed 'A non-numeric value encountered in theme_pager()'
19+
- PHP 7.x: Fixed file.inc generated .htaccess does not cover PHP 7
20+
- PHP 5.3: Fixed check_plain() 'Invalid multibyte sequence in argument' test failures
21+
- Fixed: Allow passing data as array to drupal_http_request()
22+
- Fixed: Skip module_invoke/module_hook in calling hook_watchdog (excessive function_exist)
23+
- Fixed: HTTP status 200 returned for 'Additional uncaught exception thrown while handling exception'
24+
- Fixed: theme_table() should take an optional footer variable and produce <tfoot>
25+
- Fixed: 'uasort() expects parameter 1 to be array, null given in node_view_multiple()'
26+
- [regression] Fix default.settings.php permission
27+
428
Drupal 7.67, 2019-05-08
529
-----------------------
630
- Fixed security issues:

MAINTAINERS.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ The Drupal Core branch maintainers oversee the development of Drupal as a whole.
1111
The branch maintainers for Drupal 7 are:
1212

1313
- Dries Buytaert 'dries' https://www.drupal.org/u/dries
14-
- Angela Byron 'webchick' https://www.drupal.org/u/webchick
1514
- Fabian Franz 'Fabianx' https://www.drupal.org/u/fabianx
16-
- David Rothstein 'David_Rothstein' https://www.drupal.org/u/david_rothstein
17-
- Stefan Ruijsenaars 'stefan.r' https://www.drupal.org/u/stefanr-0
18-
- (provisional) Pol Dellaiera 'Pol' https://www.drupal.org/u/pol
15+
- (provisional) Drew Webber 'mcdruid' https://www.drupal.org/u/mcdruid
1916

2017

2118
Component maintainers

includes/ajax.inc

+1
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ function ajax_render($commands = array()) {
294294

295295
// Now add a command to merge changes and additions to Drupal.settings.
296296
$scripts = drupal_add_js();
297+
drupal_alter('js', $scripts);
297298
if (!empty($scripts['settings'])) {
298299
$settings = $scripts['settings'];
299300
array_unshift($commands, ajax_command_settings(drupal_array_merge_deep_array($settings['data']), TRUE));

includes/bootstrap.inc

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* The current system version.
1010
*/
11-
define('VERSION', '7.67');
11+
define('VERSION', '7.69');
1212

1313
/**
1414
* Core API compatibility.
@@ -1998,7 +1998,7 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
19981998

19991999
// It is possible that the error handling will itself trigger an error. In that case, we could
20002000
// end up in an infinite loop. To avoid that, we implement a simple static semaphore.
2001-
if (!$in_error_state && function_exists('module_implements')) {
2001+
if (!$in_error_state && function_exists('module_invoke_all')) {
20022002
$in_error_state = TRUE;
20032003

20042004
// The user object may not exist in all conditions, so 0 is substituted if needed.
@@ -2021,9 +2021,7 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
20212021
);
20222022

20232023
// Call the logging hooks to log/process the message
2024-
foreach (module_implements('watchdog') as $module) {
2025-
module_invoke($module, 'watchdog', $log_entry);
2026-
}
2024+
module_invoke_all('watchdog', $log_entry);
20272025

20282026
// It is critical that the semaphore is only cleared here, in the parent
20292027
// watchdog() call (not outside the loop), to prevent recursive execution.
@@ -2518,6 +2516,7 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
25182516

25192517
switch ($current_phase) {
25202518
case DRUPAL_BOOTSTRAP_CONFIGURATION:
2519+
require_once DRUPAL_ROOT . '/includes/request-sanitizer.inc';
25212520
_drupal_bootstrap_configuration();
25222521
break;
25232522

@@ -2622,6 +2621,10 @@ function _drupal_exception_handler($exception) {
26222621
_drupal_log_error(_drupal_decode_exception($exception), TRUE);
26232622
}
26242623
catch (Exception $exception2) {
2624+
// Add a 500 status code in case an exception was thrown before the 500
2625+
// status could be set (e.g. while loading a maintenance theme from cache).
2626+
drupal_add_http_header('Status', '500 Internal Server Error');
2627+
26252628
// Another uncaught exception was thrown while handling the first one.
26262629
// If we are displaying errors, then do so with no possibility of a further uncaught exception being thrown.
26272630
if (error_displayable()) {
@@ -2647,7 +2650,6 @@ function _drupal_bootstrap_configuration() {
26472650
drupal_settings_initialize();
26482651

26492652
// Sanitize unsafe keys from the request.
2650-
require_once DRUPAL_ROOT . '/includes/request-sanitizer.inc';
26512653
DrupalRequestSanitizer::sanitize();
26522654
}
26532655

includes/common.inc

+93-37
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,10 @@ function drupal_access_denied() {
760760
* (optional) An array that can have one or more of the following elements:
761761
* - headers: An array containing request headers to send as name/value pairs.
762762
* - method: A string containing the request method. Defaults to 'GET'.
763-
* - data: A string containing the request body, formatted as
764-
* 'param=value&param=value&...'; to generate this, use http_build_query().
765-
* Defaults to NULL.
763+
* - data: An array containing the values for the request body or a string
764+
* containing the request body, formatted as
765+
* 'param=value&param=value&...'; to generate this, use
766+
* drupal_http_build_query(). Defaults to NULL.
766767
* - max_redirects: An integer representing how many times a redirect
767768
* may be followed. Defaults to 3.
768769
* - timeout: A float representing the maximum number of seconds the function
@@ -788,7 +789,7 @@ function drupal_access_denied() {
788789
* easy access the array keys are returned in lower case.
789790
* - data: A string containing the response body that was received.
790791
*
791-
* @see http_build_query()
792+
* @see drupal_http_build_query()
792793
*/
793794
function drupal_http_request($url, array $options = array()) {
794795
// Allow an alternate HTTP client library to replace Drupal's default
@@ -930,6 +931,11 @@ function drupal_http_request($url, array $options = array()) {
930931
$path .= '?' . $uri['query'];
931932
}
932933

934+
// Convert array $options['data'] to query string.
935+
if (is_array($options['data'])) {
936+
$options['data'] = drupal_http_build_query($options['data']);
937+
}
938+
933939
// Only add Content-Length if we actually have any content or if it is a POST
934940
// or PUT request. Some non-standard servers get confused by Content-Length in
935941
// at least HEAD/GET requests, and Squid always requires Content-Length in
@@ -4441,12 +4447,54 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
44414447
}
44424448
}
44434449

4444-
$output = '';
4445-
// The index counter is used to keep aggregated and non-aggregated files in
4446-
// order by weight.
4447-
$index = 1;
4448-
$processed = array();
4449-
$files = array();
4450+
// Sort the JavaScript so that it appears in the correct order.
4451+
uasort($items, 'drupal_sort_css_js');
4452+
4453+
// Provide the page with information about the individual JavaScript files
4454+
// used, information not otherwise available when aggregation is enabled.
4455+
$setting['ajaxPageState']['js'] = array_fill_keys(array_keys($items), 1);
4456+
unset($setting['ajaxPageState']['js']['settings']);
4457+
drupal_add_js($setting, 'setting');
4458+
4459+
// If we're outputting the header scope, then this might be the final time
4460+
// that drupal_get_js() is running, so add the setting to this output as well
4461+
// as to the drupal_add_js() cache. If $items['settings'] doesn't exist, it's
4462+
// because drupal_get_js() was intentionally passed a $javascript argument
4463+
// stripped off settings, potentially in order to override how settings get
4464+
// output, so in this case, do not add the setting to this output.
4465+
if ($scope == 'header' && isset($items['settings'])) {
4466+
$items['settings']['data'][] = $setting;
4467+
}
4468+
4469+
$elements = array(
4470+
'#type' => 'scripts',
4471+
'#items' => $items,
4472+
);
4473+
4474+
return drupal_render($elements);
4475+
}
4476+
4477+
/**
4478+
* The #pre_render callback for the "scripts" element.
4479+
*
4480+
* This callback adds elements needed for <script> tags to be rendered.
4481+
*
4482+
* @param array $elements
4483+
* A render array containing:
4484+
* - '#items': The JS items as returned by drupal_add_js() and altered by
4485+
* drupal_get_js().
4486+
*
4487+
* @return array
4488+
* The $elements variable passed as argument with two more children keys:
4489+
* - "scripts": contains the Javascript items
4490+
* - "settings": contains the Javascript settings items.
4491+
* If those keys are already existing, then the items will be appended and
4492+
* their keys will be preserved.
4493+
*
4494+
* @see drupal_get_js()
4495+
* @see drupal_add_js()
4496+
*/
4497+
function drupal_pre_render_scripts(array $elements) {
44504498
$preprocess_js = (variable_get('preprocess_js', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
44514499

44524500
// A dummy query-string is added to filenames, to gain control over
@@ -4467,34 +4515,29 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
44674515
// third-party code might require the use of a different query string.
44684516
$js_version_string = variable_get('drupal_js_version_query_string', 'v=');
44694517

4470-
// Sort the JavaScript so that it appears in the correct order.
4471-
uasort($items, 'drupal_sort_css_js');
4518+
$files = array();
44724519

4473-
// Provide the page with information about the individual JavaScript files
4474-
// used, information not otherwise available when aggregation is enabled.
4475-
$setting['ajaxPageState']['js'] = array_fill_keys(array_keys($items), 1);
4476-
unset($setting['ajaxPageState']['js']['settings']);
4477-
drupal_add_js($setting, 'setting');
4520+
$scripts = isset($elements['scripts']) ? $elements['scripts'] : array();
4521+
$scripts += array('#weight' => 0);
44784522

4479-
// If we're outputting the header scope, then this might be the final time
4480-
// that drupal_get_js() is running, so add the setting to this output as well
4481-
// as to the drupal_add_js() cache. If $items['settings'] doesn't exist, it's
4482-
// because drupal_get_js() was intentionally passed a $javascript argument
4483-
// stripped off settings, potentially in order to override how settings get
4484-
// output, so in this case, do not add the setting to this output.
4485-
if ($scope == 'header' && isset($items['settings'])) {
4486-
$items['settings']['data'][] = $setting;
4487-
}
4523+
$settings = isset($elements['settings']) ? $elements['settings'] : array();
4524+
$settings += array('#weight' => $scripts['#weight'] + 10);
4525+
4526+
// The index counter is used to keep aggregated and non-aggregated files in
4527+
// order by weight. Use existing scripts count as a starting point.
4528+
$index = count(element_children($scripts)) + 1;
44884529

44894530
// Loop through the JavaScript to construct the rendered output.
44904531
$element = array(
4532+
'#type' => 'html_tag',
44914533
'#tag' => 'script',
44924534
'#value' => '',
44934535
'#attributes' => array(
44944536
'type' => 'text/javascript',
44954537
),
44964538
);
4497-
foreach ($items as $item) {
4539+
4540+
foreach ($elements['#items'] as $item) {
44984541
$query_string = empty($item['version']) ? $default_query_string : $js_version_string . $item['version'];
44994542

45004543
switch ($item['type']) {
@@ -4503,7 +4546,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
45034546
$js_element['#value_prefix'] = $embed_prefix;
45044547
$js_element['#value'] = 'jQuery.extend(Drupal.settings, ' . drupal_json_encode(drupal_array_merge_deep_array($item['data'])) . ");";
45054548
$js_element['#value_suffix'] = $embed_suffix;
4506-
$output .= theme('html_tag', array('element' => $js_element));
4549+
$settings[] = $js_element;
45074550
break;
45084551

45094552
case 'inline':
@@ -4514,7 +4557,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
45144557
$js_element['#value_prefix'] = $embed_prefix;
45154558
$js_element['#value'] = $item['data'];
45164559
$js_element['#value_suffix'] = $embed_suffix;
4517-
$processed[$index++] = theme('html_tag', array('element' => $js_element));
4560+
$scripts[$index++] = $js_element;
45184561
break;
45194562

45204563
case 'file':
@@ -4525,7 +4568,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
45254568
}
45264569
$query_string_separator = (strpos($item['data'], '?') !== FALSE) ? '&' : '?';
45274570
$js_element['#attributes']['src'] = file_create_url($item['data']) . $query_string_separator . ($item['cache'] ? $query_string : REQUEST_TIME);
4528-
$processed[$index++] = theme('html_tag', array('element' => $js_element));
4571+
$scripts[$index++] = $js_element;
45294572
}
45304573
else {
45314574
// By increasing the index for each aggregated file, we maintain
@@ -4536,7 +4579,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
45364579
// leading to better front-end performance of a website as a whole.
45374580
// See drupal_add_js() for details.
45384581
$key = 'aggregate_' . $item['group'] . '_' . $item['every_page'] . '_' . $index;
4539-
$processed[$key] = '';
4582+
$scripts[$key] = '';
45404583
$files[$key][$item['data']] = $item;
45414584
}
45424585
break;
@@ -4548,7 +4591,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
45484591
$js_element['#attributes']['defer'] = 'defer';
45494592
}
45504593
$js_element['#attributes']['src'] = $item['data'];
4551-
$processed[$index++] = theme('html_tag', array('element' => $js_element));
4594+
$scripts[$index++] = $js_element;
45524595
break;
45534596
}
45544597
}
@@ -4563,14 +4606,18 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
45634606
$preprocess_file = file_create_url($uri);
45644607
$js_element = $element;
45654608
$js_element['#attributes']['src'] = $preprocess_file;
4566-
$processed[$key] = theme('html_tag', array('element' => $js_element));
4609+
$scripts[$key] = $js_element;
45674610
}
45684611
}
45694612
}
45704613

4571-
// Keep the order of JS files consistent as some are preprocessed and others are not.
4572-
// Make sure any inline or JS setting variables appear last after libraries have loaded.
4573-
return implode('', $processed) . $output;
4614+
// Keep the order of JS files consistent as some are preprocessed and others
4615+
// are not. Make sure any inline or JS setting variables appear last after
4616+
// libraries have loaded.
4617+
$element['scripts'] = $scripts;
4618+
$element['settings'] = $settings;
4619+
4620+
return $element;
45744621
}
45754622

45764623
/**
@@ -6952,7 +6999,16 @@ function drupal_common_theme() {
69526999
'variables' => array(),
69537000
),
69547001
'table' => array(
6955-
'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'empty' => ''),
7002+
'variables' => array(
7003+
'header' => NULL,
7004+
'footer' => NULL,
7005+
'rows' => NULL,
7006+
'attributes' => array(),
7007+
'caption' => NULL,
7008+
'colgroups' => array(),
7009+
'sticky' => TRUE,
7010+
'empty' => '',
7011+
),
69567012
),
69577013
'tablesort_indicator' => array(
69587014
'variables' => array('style' => NULL),

includes/file.inc

+3
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
532532
<IfModule mod_php5.c>
533533
php_flag engine off
534534
</IfModule>
535+
<IfModule mod_php7.c>
536+
php_flag engine off
537+
</IfModule>
535538
EOF;
536539

537540
if ($private) {

includes/pager.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function theme_pager($variables) {
321321
$tags = $variables['tags'];
322322
$element = $variables['element'];
323323
$parameters = $variables['parameters'];
324-
$quantity = $variables['quantity'];
324+
$quantity = empty($variables['quantity']) ? 0 : $variables['quantity'];
325325
global $pager_page_array, $pager_total;
326326

327327
// Calculate various markers within this pager piece:

0 commit comments

Comments
 (0)