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

Commit 15c9ea5

Browse files
committed
Updated drupal
1 parent 2999826 commit 15c9ea5

File tree

167 files changed

+938
-455
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

+938
-455
lines changed

CHANGELOG.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11

2+
Drupal 7.52, 2016-11-16
3+
-----------------------
4+
- Fixed security issues (multiple vulnerabilities). See SA-CORE-2016-005.
5+
6+
Drupal 7.51, 2016-10-05
7+
-----------------------
8+
- The Update module now also checks for updates to a disabled theme that is
9+
used as an admin theme.
10+
- Exceptions thrown in dblog_watchdog() are now caught and ignored.
11+
- Clarified the warning that appears when modules are missing or have moved.
12+
- Log messages are now XSS filtered on display.
13+
- Draggable tables now work on touch screen devices.
14+
- Added a setting for allowing double underscores in CSS identifiers
15+
(https://www.drupal.org/node/2810369).
16+
- If a user navigates away from a page while an Ajax request is running they
17+
will no longer get an error message saying "An Ajax HTTP request terminated
18+
abnormally".
19+
- The system_region_list() API function now takes an optional third parameter
20+
which allows region name translations to be skipped when they are not needed
21+
(API addition: https://www.drupal.org/node/2810365).
22+
- Numerous performance improvements.
23+
- Numerous bug fixes.
24+
- Numerous API documentation improvements.
25+
- Additional automated test coverage.
26+
227
Drupal 7.50, 2016-07-07
328
-----------------------
429
- Added a new "administer fields" permission for trusted users, which is

MAINTAINERS.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ User experience and usability
145145
Node Access
146146
- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman
147147
- Ken Rickard 'agentrickard' https://www.drupal.org/u/agentrickard
148-
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
149148

150149

151150
Security team
@@ -268,7 +267,6 @@ System module
268267
- ?
269268

270269
Taxonomy module
271-
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
272270
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
273271
- Benjamin Doherty 'bangpound' https://www.drupal.org/u/bangpound
274272

includes/bootstrap.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* The current system version.
1010
*/
11-
define('VERSION', '7.50');
11+
define('VERSION', '7.52');
1212

1313
/**
1414
* Core API compatibility.
@@ -1072,8 +1072,8 @@ function _drupal_get_filename_perform_file_scan($type, $name) {
10721072
*/
10731073
function _drupal_get_filename_fallback_trigger_error($type, $name, $error_type) {
10741074
// Hide messages due to known bugs that will appear on a lot of sites.
1075-
// @todo Remove this in https://www.drupal.org/node/2762241
1076-
if (empty($name) || ($type == 'module' && $name == 'default')) {
1075+
// @todo Remove this in https://www.drupal.org/node/2383823
1076+
if (empty($name)) {
10771077
return;
10781078
}
10791079

@@ -1085,7 +1085,7 @@ function _drupal_get_filename_fallback_trigger_error($type, $name, $error_type)
10851085
// triggered during low-level operations that cannot necessarily be
10861086
// interrupted by a watchdog() call.
10871087
if ($error_type == 'missing') {
1088-
_drupal_trigger_error_with_delayed_logging(format_string('The following @type is missing from the file system: %name. In order to fix this, put the @type back in its original location. For more information, see <a href="@documentation">the documentation page</a>.', array('@type' => $type, '%name' => $name, '@documentation' => 'https://www.drupal.org/node/2487215')), E_USER_WARNING);
1088+
_drupal_trigger_error_with_delayed_logging(format_string('The following @type is missing from the file system: %name. For information about how to fix this, see <a href="@documentation">the documentation page</a>.', array('@type' => $type, '%name' => $name, '@documentation' => 'https://www.drupal.org/node/2487215')), E_USER_WARNING);
10891089
}
10901090
elseif ($error_type == 'moved') {
10911091
_drupal_trigger_error_with_delayed_logging(format_string('The following @type has moved within the file system: %name. In order to fix this, clear caches or put the @type back in its original location. For more information, see <a href="@documentation">the documentation page</a>.', array('@type' => $type, '%name' => $name, '@documentation' => 'https://www.drupal.org/node/2487215')), E_USER_WARNING);

includes/common.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,6 +3900,21 @@ function drupal_delete_file_if_stale($uri) {
39003900
* The cleaned identifier.
39013901
*/
39023902
function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')) {
3903+
// Use the advanced drupal_static() pattern, since this is called very often.
3904+
static $drupal_static_fast;
3905+
if (!isset($drupal_static_fast)) {
3906+
$drupal_static_fast['allow_css_double_underscores'] = &drupal_static(__FUNCTION__ . ':allow_css_double_underscores');
3907+
}
3908+
$allow_css_double_underscores = &$drupal_static_fast['allow_css_double_underscores'];
3909+
if (!isset($allow_css_double_underscores)) {
3910+
$allow_css_double_underscores = variable_get('allow_css_double_underscores', FALSE);
3911+
}
3912+
3913+
// Preserve BEM-style double-underscores depending on custom setting.
3914+
if ($allow_css_double_underscores) {
3915+
$filter['__'] = '__';
3916+
}
3917+
39033918
// By default, we filter using Drupal's coding standards.
39043919
$identifier = strtr($identifier, $filter);
39053920

includes/database/database.inc

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,20 @@ abstract class DatabaseConnection extends PDO {
296296
*/
297297
protected $prefixReplace = array();
298298

299+
/**
300+
* List of escaped database, table, and field names, keyed by unescaped names.
301+
*
302+
* @var array
303+
*/
304+
protected $escapedNames = array();
305+
306+
/**
307+
* List of escaped aliases names, keyed by unescaped aliases.
308+
*
309+
* @var array
310+
*/
311+
protected $escapedAliases = array();
312+
299313
function __construct($dsn, $username, $password, $driver_options = array()) {
300314
// Initialize and prepare the connection prefix.
301315
$this->setPrefix(isset($this->connectionOptions['prefix']) ? $this->connectionOptions['prefix'] : '');
@@ -919,11 +933,14 @@ abstract class DatabaseConnection extends PDO {
919933
* For some database drivers, it may also wrap the table name in
920934
* database-specific escape characters.
921935
*
922-
* @return
936+
* @return string
923937
* The sanitized table name string.
924938
*/
925939
public function escapeTable($table) {
926-
return preg_replace('/[^A-Za-z0-9_.]+/', '', $table);
940+
if (!isset($this->escapedNames[$table])) {
941+
$this->escapedNames[$table] = preg_replace('/[^A-Za-z0-9_.]+/', '', $table);
942+
}
943+
return $this->escapedNames[$table];
927944
}
928945

929946
/**
@@ -933,11 +950,14 @@ abstract class DatabaseConnection extends PDO {
933950
* For some database drivers, it may also wrap the field name in
934951
* database-specific escape characters.
935952
*
936-
* @return
953+
* @return string
937954
* The sanitized field name string.
938955
*/
939956
public function escapeField($field) {
940-
return preg_replace('/[^A-Za-z0-9_.]+/', '', $field);
957+
if (!isset($this->escapedNames[$field])) {
958+
$this->escapedNames[$field] = preg_replace('/[^A-Za-z0-9_.]+/', '', $field);
959+
}
960+
return $this->escapedNames[$field];
941961
}
942962

943963
/**
@@ -948,11 +968,14 @@ abstract class DatabaseConnection extends PDO {
948968
* DatabaseConnection::escapeTable(), this doesn't allow the period (".")
949969
* because that is not allowed in aliases.
950970
*
951-
* @return
971+
* @return string
952972
* The sanitized field name string.
953973
*/
954974
public function escapeAlias($field) {
955-
return preg_replace('/[^A-Za-z0-9_]+/', '', $field);
975+
if (!isset($this->escapedAliases[$field])) {
976+
$this->escapedAliases[$field] = preg_replace('/[^A-Za-z0-9_]+/', '', $field);
977+
}
978+
return $this->escapedAliases[$field];
956979
}
957980

958981
/**

includes/database/mysql/database.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class DatabaseConnection_mysql extends DatabaseConnection {
240240

241241
// Ensure that the MySQL server supports large prefixes and utf8mb4.
242242
try {
243-
$this->query("CREATE TABLE {drupal_utf8mb4_test} (id VARCHAR(255), PRIMARY KEY(id(255))) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ROW_FORMAT=DYNAMIC");
243+
$this->query("CREATE TABLE {drupal_utf8mb4_test} (id VARCHAR(255), PRIMARY KEY(id(255))) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ROW_FORMAT=DYNAMIC ENGINE=INNODB");
244244
}
245245
catch (Exception $e) {
246246
return FALSE;

includes/database/select.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,21 @@ class SelectQuery extends Query implements SelectQueryInterface {
12311231

12321232
// Modules may alter all queries or only those having a particular tag.
12331233
if (isset($this->alterTags)) {
1234+
// Many contrib modules assume that query tags used for access-checking
1235+
// purposes follow the pattern $entity_type . '_access'. But this is
1236+
// not the case for taxonomy terms, since core used to add term_access
1237+
// instead of taxonomy_term_access to its queries. Provide backwards
1238+
// compatibility by adding both tags here instead of attempting to fix
1239+
// all contrib modules in a coordinated effort.
1240+
// TODO:
1241+
// - Extract this mechanism into a hook as part of a public (non-security)
1242+
// issue.
1243+
// - Emit E_USER_DEPRECATED if term_access is used.
1244+
// https://www.drupal.org/node/2575081
1245+
$term_access_tags = array('term_access' => 1, 'taxonomy_term_access' => 1);
1246+
if (array_intersect_key($this->alterTags, $term_access_tags)) {
1247+
$this->alterTags += $term_access_tags;
1248+
}
12341249
$hooks = array('query');
12351250
foreach ($this->alterTags as $tag => $value) {
12361251
$hooks[] = 'query_' . $tag;

includes/file.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ function file_default_scheme() {
273273
* The normalized URI.
274274
*/
275275
function file_stream_wrapper_uri_normalize($uri) {
276-
$scheme = file_uri_scheme($uri);
276+
// Inline file_uri_scheme() function call for performance reasons.
277+
$position = strpos($uri, '://');
278+
$scheme = $position ? substr($uri, 0, $position) : FALSE;
277279

278280
if ($scheme && file_stream_wrapper_valid_scheme($scheme)) {
279281
$target = file_uri_target($uri);

includes/locale.inc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,6 @@ function locale_add_language($langcode, $name = NULL, $native = NULL, $direction
667667
* translations).
668668
*/
669669
function _locale_import_po($file, $langcode, $mode, $group = NULL) {
670-
// Try to allocate enough time to parse and import the data.
671-
drupal_set_time_limit(240);
672-
673670
// Check if we have the language already in the database.
674671
if (!db_query("SELECT COUNT(language) FROM {languages} WHERE language = :language", array(':language' => $langcode))->fetchField()) {
675672
drupal_set_message(t('The language selected for import is not supported.'), 'error');
@@ -753,6 +750,12 @@ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group =
753750
$lineno = 0;
754751

755752
while (!feof($fd)) {
753+
// Refresh the time limit every 10 parsed rows to ensure there is always
754+
// enough time to import the data for large PO files.
755+
if (!($lineno % 10)) {
756+
drupal_set_time_limit(30);
757+
}
758+
756759
// A line should not be longer than 10 * 1024.
757760
$line = fgets($fd, 10 * 1024);
758761

includes/theme.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ function path_to_theme() {
12481248
function drupal_find_theme_functions($cache, $prefixes) {
12491249
$implementations = array();
12501250
$functions = get_defined_functions();
1251+
$theme_functions = preg_grep('/^(' . implode(')|(', $prefixes) . ')_/', $functions['user']);
12511252

12521253
foreach ($cache as $hook => $info) {
12531254
foreach ($prefixes as $prefix) {
@@ -1264,7 +1265,7 @@ function drupal_find_theme_functions($cache, $prefixes) {
12641265
// intermediary suggestion.
12651266
$pattern = isset($info['pattern']) ? $info['pattern'] : ($hook . '__');
12661267
if (!isset($info['base hook']) && !empty($pattern)) {
1267-
$matches = preg_grep('/^' . $prefix . '_' . $pattern . '/', $functions['user']);
1268+
$matches = preg_grep('/^' . $prefix . '_' . $pattern . '/', $theme_functions);
12681269
if ($matches) {
12691270
foreach ($matches as $match) {
12701271
$new_hook = substr($match, strlen($prefix) + 1);
@@ -2638,7 +2639,7 @@ function template_preprocess_page(&$variables) {
26382639
// Move some variables to the top level for themer convenience and template cleanliness.
26392640
$variables['show_messages'] = $variables['page']['#show_messages'];
26402641

2641-
foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) {
2642+
foreach (system_region_list($GLOBALS['theme'], REGIONS_ALL, FALSE) as $region_key) {
26422643
if (!isset($variables['page'][$region_key])) {
26432644
$variables['page'][$region_key] = array();
26442645
}

misc/ajax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ Drupal.ajax.prototype.getEffect = function (response) {
476476
* Handler for the form redirection error.
477477
*/
478478
Drupal.ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
479-
alert(Drupal.ajaxError(xmlhttprequest, uri, customMessage));
479+
Drupal.displayAjaxError(Drupal.ajaxError(xmlhttprequest, uri, customMessage));
480480
// Remove the progress element.
481481
if (this.progress.element) {
482482
$(this.progress.element).remove();

misc/autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Drupal.ACDB.prototype.search = function (searchString) {
310310
}
311311
},
312312
error: function (xmlhttp) {
313-
alert(Drupal.ajaxError(xmlhttp, db.uri));
313+
Drupal.displayAjaxError(Drupal.ajaxError(xmlhttp, db.uri));
314314
}
315315
});
316316
}, this.delay);

misc/drupal.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,29 @@ Drupal.getSelection = function (element) {
413413
return { 'start': element.selectionStart, 'end': element.selectionEnd };
414414
};
415415

416+
/**
417+
* Add a global variable which determines if the window is being unloaded.
418+
*
419+
* This is primarily used by Drupal.displayAjaxError().
420+
*/
421+
Drupal.beforeUnloadCalled = false;
422+
$(window).bind('beforeunload pagehide', function () {
423+
Drupal.beforeUnloadCalled = true;
424+
});
425+
426+
/**
427+
* Displays a JavaScript error from an Ajax response when appropriate to do so.
428+
*/
429+
Drupal.displayAjaxError = function (message) {
430+
// Skip displaying the message if the user deliberately aborted (for example,
431+
// by reloading the page or navigating to a different page) while the Ajax
432+
// request was still ongoing. See, for example, the discussion at
433+
// http://stackoverflow.com/questions/699941/handle-ajax-error-when-a-user-clicks-refresh.
434+
if (!Drupal.beforeUnloadCalled) {
435+
alert(message);
436+
}
437+
};
438+
416439
/**
417440
* Build an error message from an Ajax response.
418441
*/

misc/tabledrag.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ Drupal.tableDrag = function (table, tableSettings) {
106106

107107
// Add mouse bindings to the document. The self variable is passed along
108108
// as event handlers do not have direct access to the tableDrag object.
109-
$(document).bind('mousemove', function (event) { return self.dragRow(event, self); });
110-
$(document).bind('mouseup', function (event) { return self.dropRow(event, self); });
109+
$(document).bind('mousemove pointermove', function (event) { return self.dragRow(event, self); });
110+
$(document).bind('mouseup pointerup', function (event) { return self.dropRow(event, self); });
111+
$(document).bind('touchmove', function (event) { return self.dragRow(event.originalEvent.touches[0], self); });
112+
$(document).bind('touchend', function (event) { return self.dropRow(event.originalEvent.touches[0], self); });
111113
};
112114

113115
/**
@@ -274,7 +276,10 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
274276
});
275277

276278
// Add the mousedown action for the handle.
277-
handle.mousedown(function (event) {
279+
handle.bind('mousedown touchstart pointerdown', function (event) {
280+
if (event.originalEvent.type == "touchstart") {
281+
event = event.originalEvent.touches[0];
282+
}
278283
// Create a new dragObject recording the event information.
279284
self.dragObject = {};
280285
self.dragObject.initMouseOffset = self.getMouseOffset(item, event);

modules/aggregator/aggregator.info

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ files[] = aggregator.test
77
configure = admin/config/services/aggregator/settings
88
stylesheets[all][] = aggregator.css
99

10-
; Information added by Drupal.org packaging script on 2016-07-07
11-
version = "7.50"
10+
; Information added by Drupal.org packaging script on 2016-11-16
11+
version = "7.52"
1212
project = "drupal"
13-
datestamp = "1467918493"
13+
datestamp = "1479322922"
1414

modules/aggregator/aggregator.processor.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function aggregator_aggregator_remove($feed) {
7272
*/
7373
function aggregator_form_aggregator_admin_form_alter(&$form, $form_state) {
7474
if (in_array('aggregator', variable_get('aggregator_processors', array('aggregator')))) {
75-
$info = module_invoke('aggregator', 'aggregator_process', 'info');
75+
$info = module_invoke('aggregator', 'aggregator_process_info');
7676
$items = drupal_map_assoc(array(3, 5, 10, 15, 20, 25), '_aggregator_items');
7777
$period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
7878
$period[AGGREGATOR_CLEAR_NEVER] = t('Never');

modules/aggregator/tests/aggregator_test.info

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ version = VERSION
55
core = 7.x
66
hidden = TRUE
77

8-
; Information added by Drupal.org packaging script on 2016-07-07
9-
version = "7.50"
8+
; Information added by Drupal.org packaging script on 2016-11-16
9+
version = "7.52"
1010
project = "drupal"
11-
datestamp = "1467918493"
11+
datestamp = "1479322922"
1212

modules/block/block.info

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ core = 7.x
66
files[] = block.test
77
configure = admin/structure/block
88

9-
; Information added by Drupal.org packaging script on 2016-07-07
10-
version = "7.50"
9+
; Information added by Drupal.org packaging script on 2016-11-16
10+
version = "7.52"
1111
project = "drupal"
12-
datestamp = "1467918493"
12+
datestamp = "1479322922"
1313

modules/block/block.module

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ function block_page_build(&$page) {
285285
// Append region description if we are rendering the regions demo page.
286286
$item = menu_get_item();
287287
if ($item['path'] == 'admin/structure/block/demo/' . $theme) {
288-
$visible_regions = array_keys(system_region_list($theme, REGIONS_VISIBLE));
289-
foreach ($visible_regions as $region) {
288+
foreach (system_region_list($theme, REGIONS_VISIBLE, FALSE) as $region) {
290289
$description = '<div class="block-region">' . $all_regions[$region] . '</div>';
291290
$page[$region]['block_description'] = array(
292291
'#markup' => $description,

modules/block/tests/block_test.info

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ version = VERSION
55
core = 7.x
66
hidden = TRUE
77

8-
; Information added by Drupal.org packaging script on 2016-07-07
9-
version = "7.50"
8+
; Information added by Drupal.org packaging script on 2016-11-16
9+
version = "7.52"
1010
project = "drupal"
11-
datestamp = "1467918493"
11+
datestamp = "1479322922"
1212

0 commit comments

Comments
 (0)