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

Commit ad06b64

Browse files
committed
Merge branch 'zorp-master' into development
2 parents 36c732b + e201b9f commit ad06b64

File tree

19,566 files changed

+1817901
-20706
lines changed

Some content is hidden

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

19,566 files changed

+1817901
-20706
lines changed

CHANGELOG.txt

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

2+
Drupal 7.54, 2017-02-01
3+
-----------------------
4+
- Modules are now able to define theme engines (API addition:
5+
https://www.drupal.org/node/2826480).
6+
- Logging of searches can now be disabled (new option in the administrative
7+
interface).
8+
- Added menu tree render structure to (pre-)process hooks for theme_menu_tree()
9+
(API addition: https://www.drupal.org/node/2827134).
10+
- Added new function for determining whether an HTTPS request is being served
11+
(API addition: https://www.drupal.org/node/2824590).
12+
- Fixed incorrect default value for short and medium date formats on the date
13+
type configuration page.
14+
- File validation error message is now removed after subsequent upload of valid
15+
file.
16+
- Numerous bug fixes.
17+
- Numerous API documentation improvements.
18+
- Additional performance improvements.
19+
- Additional automated test coverage.
20+
21+
Drupal 7.53, 2016-12-07
22+
-----------------------
23+
- Fixed drag and drop support on newer Chrome/IE 11+ versions after 7.51 update
24+
when jQuery is updated to 1.7-1.11.0.
25+
26+
Drupal 7.52, 2016-11-16
27+
-----------------------
28+
- Fixed security issues (multiple vulnerabilities). See SA-CORE-2016-005.
29+
30+
Drupal 7.51, 2016-10-05
31+
-----------------------
32+
- The Update module now also checks for updates to a disabled theme that is
33+
used as an admin theme.
34+
- Exceptions thrown in dblog_watchdog() are now caught and ignored.
35+
- Clarified the warning that appears when modules are missing or have moved.
36+
- Log messages are now XSS filtered on display.
37+
- Draggable tables now work on touch screen devices.
38+
- Added a setting for allowing double underscores in CSS identifiers
39+
(https://www.drupal.org/node/2810369).
40+
- If a user navigates away from a page while an Ajax request is running they
41+
will no longer get an error message saying "An Ajax HTTP request terminated
42+
abnormally".
43+
- The system_region_list() API function now takes an optional third parameter
44+
which allows region name translations to be skipped when they are not needed
45+
(API addition: https://www.drupal.org/node/2810365).
46+
- Numerous performance improvements.
47+
- Numerous bug fixes.
48+
- Numerous API documentation improvements.
49+
- Additional automated test coverage.
50+
251
Drupal 7.50, 2016-07-07
352
-----------------------
453
- 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: 15 additions & 5 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.54');
1212

1313
/**
1414
* Core API compatibility.
@@ -718,6 +718,16 @@ function drupal_valid_http_host($host) {
718718
&& preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host);
719719
}
720720

721+
/**
722+
* Checks whether an HTTPS request is being served.
723+
*
724+
* @return bool
725+
* TRUE if the request is HTTPS, FALSE otherwise.
726+
*/
727+
function drupal_is_https() {
728+
return isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
729+
}
730+
721731
/**
722732
* Sets the base URL, cookie domain, and session name from configuration.
723733
*/
@@ -731,7 +741,7 @@ function drupal_settings_initialize() {
731741
if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) {
732742
include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php';
733743
}
734-
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
744+
$is_https = drupal_is_https();
735745

736746
if (isset($base_url)) {
737747
// Parse fixed base URL from settings.php.
@@ -1072,8 +1082,8 @@ function _drupal_get_filename_perform_file_scan($type, $name) {
10721082
*/
10731083
function _drupal_get_filename_fallback_trigger_error($type, $name, $error_type) {
10741084
// 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')) {
1085+
// @todo Remove this in https://www.drupal.org/node/2383823
1086+
if (empty($name)) {
10771087
return;
10781088
}
10791089

@@ -1085,7 +1095,7 @@ function _drupal_get_filename_fallback_trigger_error($type, $name, $error_type)
10851095
// triggered during low-level operations that cannot necessarily be
10861096
// interrupted by a watchdog() call.
10871097
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);
1098+
_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);
10891099
}
10901100
elseif ($error_type == 'moved') {
10911101
_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/cache.inc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
122122
* the administrator panel.
123123
* - cache_path: Stores the system paths that have an alias.
124124
* @param $expire
125-
* (optional) One of the following values:
125+
* (optional) Controls the maximum lifetime of this cache entry. Note that
126+
* caches might be subject to clearing at any time, so this setting does not
127+
* guarantee a minimum lifetime. With this in mind, the cache should not be
128+
* used for data that must be kept during a cache clear, like sessions.
129+
*
130+
* Use one of the following values:
126131
* - CACHE_PERMANENT: Indicates that the item should never be removed unless
127132
* explicitly told to using cache_clear_all() with a cache ID.
128133
* - CACHE_TEMPORARY: Indicates that the item should be removed at the next
@@ -262,7 +267,12 @@ interface DrupalCacheInterface {
262267
* 1MB in size to be stored by default. When caching large arrays or
263268
* similar, take care to ensure $data does not exceed this size.
264269
* @param $expire
265-
* (optional) One of the following values:
270+
* (optional) Controls the maximum lifetime of this cache entry. Note that
271+
* caches might be subject to clearing at any time, so this setting does not
272+
* guarantee a minimum lifetime. With this in mind, the cache should not be
273+
* used for data that must be kept during a cache clear, like sessions.
274+
*
275+
* Use one of the following values:
266276
* - CACHE_PERMANENT: Indicates that the item should never be removed unless
267277
* explicitly told to using cache_clear_all() with a cache ID.
268278
* - CACHE_TEMPORARY: Indicates that the item should be removed at the next

includes/common.inc

Lines changed: 24 additions & 2 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

@@ -3971,7 +3986,11 @@ function drupal_html_id($id) {
39713986
// be merged with content already on the base page. The HTML IDs must be
39723987
// unique for the fully merged content. Therefore, initialize $seen_ids to
39733988
// take into account IDs that are already in use on the base page.
3974-
$seen_ids_init = &drupal_static(__FUNCTION__ . ':init');
3989+
static $drupal_static_fast;
3990+
if (!isset($drupal_static_fast['seen_ids_init'])) {
3991+
$drupal_static_fast['seen_ids_init'] = &drupal_static(__FUNCTION__ . ':init');
3992+
}
3993+
$seen_ids_init = &$drupal_static_fast['seen_ids_init'];
39753994
if (!isset($seen_ids_init)) {
39763995
// Ideally, Drupal would provide an API to persist state information about
39773996
// prior page requests in the database, and we'd be able to add this
@@ -4016,7 +4035,10 @@ function drupal_html_id($id) {
40164035
}
40174036
}
40184037
}
4019-
$seen_ids = &drupal_static(__FUNCTION__, $seen_ids_init);
4038+
if (!isset($drupal_static_fast['seen_ids'])) {
4039+
$drupal_static_fast['seen_ids'] = &drupal_static(__FUNCTION__, $seen_ids_init);
4040+
}
4041+
$seen_ids = &$drupal_static_fast['seen_ids'];
40204042

40214043
$id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
40224044

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/date.inc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ function system_default_date_formats() {
1212
$formats = array();
1313

1414
// Short date formats.
15-
$formats[] = array(
16-
'type' => 'short',
17-
'format' => 'Y-m-d H:i',
18-
'locales' => array(),
19-
);
2015
$formats[] = array(
2116
'type' => 'short',
2217
'format' => 'm/d/Y - H:i',
@@ -37,6 +32,11 @@ function system_default_date_formats() {
3732
'format' => 'd.m.Y - H:i',
3833
'locales' => array('de-ch', 'de-de', 'de-lu', 'fi-fi', 'fr-ch', 'is-is', 'pl-pl', 'ro-ro', 'ru-ru'),
3934
);
35+
$formats[] = array(
36+
'type' => 'short',
37+
'format' => 'Y-m-d H:i',
38+
'locales' => array(),
39+
);
4040
$formats[] = array(
4141
'type' => 'short',
4242
'format' => 'm/d/Y - g:ia',
@@ -84,11 +84,6 @@ function system_default_date_formats() {
8484
);
8585

8686
// Medium date formats.
87-
$formats[] = array(
88-
'type' => 'medium',
89-
'format' => 'D, Y-m-d H:i',
90-
'locales' => array(),
91-
);
9287
$formats[] = array(
9388
'type' => 'medium',
9489
'format' => 'D, m/d/Y - H:i',
@@ -104,6 +99,11 @@ function system_default_date_formats() {
10499
'format' => 'D, Y/m/d - H:i',
105100
'locales' => array('en-ca', 'fr-ca', 'no-no', 'sv-se'),
106101
);
102+
$formats[] = array(
103+
'type' => 'medium',
104+
'format' => 'D, Y-m-d H:i',
105+
'locales' => array(),
106+
);
107107
$formats[] = array(
108108
'type' => 'medium',
109109
'format' => 'F j, Y - H:i',

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);

0 commit comments

Comments
 (0)