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

Commit 319747d

Browse files
committed
SERV-379: Updated drupal core
1 parent b9bf1da commit 319747d

File tree

176 files changed

+1998
-492
lines changed

Some content is hidden

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

176 files changed

+1998
-492
lines changed

CHANGELOG.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
Drupal 7.78, 2021-01-19
2+
-----------------------
3+
- Fixed security issues:
4+
- SA-CORE-2021-001
5+
6+
Drupal 7.77, 2020-12-03
7+
-----------------------
8+
- Hotfix for schema.prefixed tables
9+
10+
Drupal 7.76, 2020-12-02
11+
-----------------------
12+
- Support for MySQL 8
13+
- Core tests pass in SQLite
14+
- Better user flood control logging
15+
16+
Drupal 7.75, 2020-11-26
17+
-----------------------
18+
- Fixed security issues:
19+
- SA-CORE-2020-013
20+
21+
Drupal 7.74, 2020-11-17
22+
-----------------------
23+
- Fixed security issues:
24+
- SA-CORE-2020-012
25+
26+
Drupal 7.73, 2020-09-16
27+
-----------------------
28+
- Fixed security issues:
29+
- SA-CORE-2020-007
30+
31+
Drupal 7.72, 2020-06-17
32+
-----------------------
33+
- Fixed security issues:
34+
- SA-CORE-2020-004
35+
136
Drupal 7.71, 2020-06-03
237
-----------------------
338
- Fix for jQuery Form bug in Chromium-based browsers

MAINTAINERS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The branch maintainers for Drupal 7 are:
1212

1313
- Dries Buytaert 'dries' https://www.drupal.org/u/dries
1414
- Fabian Franz 'Fabianx' https://www.drupal.org/u/fabianx
15-
- (provisional) Drew Webber 'mcdruid' https://www.drupal.org/u/mcdruid
15+
- Drew Webber 'mcdruid' https://www.drupal.org/u/mcdruid
1616

1717

1818
Component maintainers

includes/bootstrap.inc

Lines changed: 10 additions & 8 deletions
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.78');
1212

1313
/**
1414
* Core API compatibility.
@@ -1189,19 +1189,21 @@ function variable_initialize($conf = array()) {
11891189
$variables = $cached->data;
11901190
}
11911191
else {
1192-
// Cache miss. Avoid a stampede.
1192+
// Cache miss. Avoid a stampede by acquiring a lock. If the lock fails to
1193+
// acquire, optionally just continue with uncached processing.
11931194
$name = 'variable_init';
1194-
if (!lock_acquire($name, 1)) {
1195-
// Another request is building the variable cache.
1196-
// Wait, then re-run this function.
1195+
$lock_acquired = lock_acquire($name, 1);
1196+
if (!$lock_acquired && variable_get('variable_initialize_wait_for_lock', FALSE)) {
11971197
lock_wait($name);
11981198
return variable_initialize($conf);
11991199
}
12001200
else {
1201-
// Proceed with variable rebuild.
1201+
// Load the variables from the table.
12021202
$variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed());
1203-
cache_set('variables', $variables, 'cache_bootstrap');
1204-
lock_release($name);
1203+
if ($lock_acquired) {
1204+
cache_set('variables', $variables, 'cache_bootstrap');
1205+
lock_release($name);
1206+
}
12051207
}
12061208
}
12071209

includes/common.inc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6653,30 +6653,41 @@ function element_children(&$elements, $sort = FALSE) {
66536653
$sort = isset($elements['#sorted']) ? !$elements['#sorted'] : $sort;
66546654

66556655
// Filter out properties from the element, leaving only children.
6656-
$children = array();
6656+
$count = count($elements);
6657+
$child_weights = array();
6658+
$i = 0;
66576659
$sortable = FALSE;
66586660
foreach ($elements as $key => $value) {
66596661
if (is_int($key) || $key === '' || $key[0] !== '#') {
6660-
$children[$key] = $value;
66616662
if (is_array($value) && isset($value['#weight'])) {
6663+
$weight = $value['#weight'];
66626664
$sortable = TRUE;
66636665
}
6666+
else {
6667+
$weight = 0;
6668+
}
6669+
// Support weights with up to three digit precision and conserve the
6670+
// insertion order.
6671+
$child_weights[$key] = floor($weight * 1000) + $i / $count;
66646672
}
6673+
$i++;
66656674
}
6675+
66666676
// Sort the children if necessary.
66676677
if ($sort && $sortable) {
6668-
uasort($children, 'element_sort');
6678+
asort($child_weights);
66696679
// Put the sorted children back into $elements in the correct order, to
66706680
// preserve sorting if the same element is passed through
66716681
// element_children() twice.
6672-
foreach ($children as $key => $child) {
6682+
foreach ($child_weights as $key => $weight) {
6683+
$value = $elements[$key];
66736684
unset($elements[$key]);
6674-
$elements[$key] = $child;
6685+
$elements[$key] = $value;
66756686
}
66766687
$elements['#sorted'] = TRUE;
66776688
}
66786689

6679-
return array_keys($children);
6690+
return array_keys($child_weights);
66806691
}
66816692

66826693
/**

includes/database/database.inc

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ abstract class DatabaseConnection extends PDO {
310310
*/
311311
protected $escapedAliases = array();
312312

313+
/**
314+
* List of un-prefixed table names, keyed by prefixed table names.
315+
*
316+
* @var array
317+
*/
318+
protected $unprefixedTablesMap = array();
319+
313320
function __construct($dsn, $username, $password, $driver_options = array()) {
314321
// Initialize and prepare the connection prefix.
315322
$this->setPrefix(isset($this->connectionOptions['prefix']) ? $this->connectionOptions['prefix'] : '');
@@ -338,7 +345,9 @@ abstract class DatabaseConnection extends PDO {
338345
// Destroy all references to this connection by setting them to NULL.
339346
// The Statement class attribute only accepts a new value that presents a
340347
// proper callable, so we reset it to PDOStatement.
341-
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatement', array()));
348+
if (!empty($this->statementClass)) {
349+
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatement', array()));
350+
}
342351
$this->schema = NULL;
343352
}
344353

@@ -442,6 +451,13 @@ abstract class DatabaseConnection extends PDO {
442451
$this->prefixReplace[] = $this->prefixes['default'];
443452
$this->prefixSearch[] = '}';
444453
$this->prefixReplace[] = '';
454+
455+
// Set up a map of prefixed => un-prefixed tables.
456+
foreach ($this->prefixes as $table_name => $prefix) {
457+
if ($table_name !== 'default') {
458+
$this->unprefixedTablesMap[$prefix . $table_name] = $table_name;
459+
}
460+
}
445461
}
446462

447463
/**
@@ -477,6 +493,17 @@ abstract class DatabaseConnection extends PDO {
477493
}
478494
}
479495

496+
/**
497+
* Gets a list of individually prefixed table names.
498+
*
499+
* @return array
500+
* An array of un-prefixed table names, keyed by their fully qualified table
501+
* names (i.e. prefix + table_name).
502+
*/
503+
public function getUnprefixedTablesMap() {
504+
return $this->unprefixedTablesMap;
505+
}
506+
480507
/**
481508
* Prepares a query string and returns the prepared statement.
482509
*
@@ -2840,7 +2867,6 @@ function db_field_exists($table, $field) {
28402867
*
28412868
* @param $table_expression
28422869
* An SQL expression, for example "simpletest%" (without the quotes).
2843-
* BEWARE: this is not prefixed, the caller should take care of that.
28442870
*
28452871
* @return
28462872
* Array, both the keys and the values are the matching tables.
@@ -2849,6 +2875,23 @@ function db_find_tables($table_expression) {
28492875
return Database::getConnection()->schema()->findTables($table_expression);
28502876
}
28512877

2878+
/**
2879+
* Finds all tables that are like the specified base table name. This is a
2880+
* backport of the change made to db_find_tables in Drupal 8 to work with
2881+
* virtual, un-prefixed table names. The original function is retained for
2882+
* Backwards Compatibility.
2883+
* @see https://www.drupal.org/node/2552435
2884+
*
2885+
* @param $table_expression
2886+
* An SQL expression, for example "simpletest%" (without the quotes).
2887+
*
2888+
* @return
2889+
* Array, both the keys and the values are the matching tables.
2890+
*/
2891+
function db_find_tables_d8($table_expression) {
2892+
return Database::getConnection()->schema()->findTablesD8($table_expression);
2893+
}
2894+
28522895
function _db_create_keys_sql($spec) {
28532896
return Database::getConnection()->schema()->createKeysSql($spec);
28542897
}

0 commit comments

Comments
 (0)