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

Commit c1a48b4

Browse files
authored
Merge pull request #14 from aakb/development
Core updates
2 parents 79c4ab6 + f7f897c commit c1a48b4

File tree

390 files changed

+1518
-727
lines changed

Some content is hidden

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

390 files changed

+1518
-727
lines changed

.htaccess

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
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)?$|^(\..*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
7-
Order allow,deny
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)$">
7+
<IfModule mod_authz_core.c>
8+
Require all denied
9+
</IfModule>
10+
<IfModule !mod_authz_core.c>
11+
Order allow,deny
12+
</IfModule>
813
</FilesMatch>
914

1015
# Don't show directory listings for URLs which map to a directory.
@@ -80,7 +85,7 @@ DirectoryIndex index.php index.html index.htm
8085
# If you do not have mod_rewrite installed, you should remove these
8186
# directories from your webroot or otherwise protect them from being
8287
# downloaded.
83-
RewriteRule "(^|/)\." - [F]
88+
RewriteRule "/\.|^\.(?!well-known/)" - [F]
8489

8590
# If your site can be accessed both with and without the 'www.' prefix, you
8691
# can use one of the following settings to redirect users to your preferred

CHANGELOG.txt

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

2+
Drupal 7.56, 2017-06-21
3+
-----------------------
4+
- Fixed security issues (access bypass). See SA-CORE-2017-003.
5+
6+
Drupal 7.55, 2017-06-07
7+
-----------------------
8+
- Fixed incompatibility with PHP versions 7.0.19 and 7.1.5 due to duplicate
9+
DATE_RFC7231 definition.
10+
- Made Drupal core pass all automated tests on PHP 7.1.
11+
- Allowed services such as Let's Encrypt to work with Drupal on Apache, by
12+
making Drupal's .htaccess file allow access to the .well-known directory
13+
defined by RFC 5785.
14+
- Made new Drupal sites work correctly on Apache 2.4 when the mod_access_compat
15+
Apache module is disabled.
16+
- Fixed Drupal's URL-generating functions to always encode '[' and ']' so that
17+
the URLs will pass HTML5 validation.
18+
- Various additional bug fixes.
19+
- Various API documentation improvements.
20+
- Additional automated test coverage.
21+
222
Drupal 7.54, 2017-02-01
323
-----------------------
424
- Modules are now able to define theme engines (API addition:

includes/bootstrap.inc

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

1313
/**
1414
* Core API compatibility.
@@ -254,8 +254,13 @@ define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
254254
* http://tools.ietf.org/html/rfc7231#section-7.1.1.1
255255
*
256256
* Example: Sun, 06 Nov 1994 08:49:37 GMT
257+
*
258+
* This constant was introduced in PHP 7.0.19 and PHP 7.1.5 but needs to be
259+
* defined by Drupal for earlier PHP versions.
257260
*/
258-
define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T');
261+
if (!defined('DATE_RFC7231')) {
262+
define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T');
263+
}
259264

260265
/**
261266
* Provides a caching wrapper to be used in place of large array structures.

includes/common.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ function drupal_http_build_query(array $query, $parent = '') {
487487
$params = array();
488488

489489
foreach ($query as $key => $value) {
490-
$key = ($parent ? $parent . '[' . rawurlencode($key) . ']' : rawurlencode($key));
490+
$key = $parent ? $parent . rawurlencode('[' . $key . ']') : rawurlencode($key);
491491

492492
// Recurse into children.
493493
if (is_array($value)) {

includes/database/pgsql/database.inc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
/**
14-
* The name by which to obtain a lock for retrive the next insert id.
14+
* The name by which to obtain a lock for retrieving the next insert id.
1515
*/
1616
define('POSTGRESQL_NEXTID_LOCK', 1000);
1717

@@ -55,7 +55,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
5555
$connection_options['pdo'] += array(
5656
// Prepared statements are most effective for performance when queries
5757
// are recycled (used several times). However, if they are not re-used,
58-
// prepared statements become ineffecient. Since most of Drupal's
58+
// prepared statements become inefficient. Since most of Drupal's
5959
// prepared queries are not re-used, it should be faster to emulate
6060
// the preparation than to actually ready statements for re-use. If in
6161
// doubt, reset to FALSE and measure performance.
@@ -175,14 +175,14 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
175175
}
176176

177177
/**
178-
* Retrive a the next id in a sequence.
178+
* Retrieve the next id in a sequence.
179179
*
180180
* PostgreSQL has built in sequences. We'll use these instead of inserting
181181
* and updating a sequences table.
182182
*/
183183
public function nextId($existing = 0) {
184184

185-
// Retrive the name of the sequence. This information cannot be cached
185+
// Retrieve the name of the sequence. This information cannot be cached
186186
// because the prefix may change, for example, like it does in simpletests.
187187
$sequence_name = $this->makeSequenceName('sequences', 'value');
188188

@@ -194,7 +194,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
194194
}
195195

196196
// PostgreSQL advisory locks are simply locks to be used by an
197-
// application such as Drupal. This will prevent other Drupal proccesses
197+
// application such as Drupal. This will prevent other Drupal processes
198198
// from altering the sequence while we are.
199199
$this->query("SELECT pg_advisory_lock(" . POSTGRESQL_NEXTID_LOCK . ")");
200200

@@ -209,7 +209,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
209209
// Reset the sequence to a higher value than the existing id.
210210
$this->query("ALTER SEQUENCE " . $sequence_name . " RESTART WITH " . ($existing + 1));
211211

212-
// Retrive the next id. We know this will be as high as we want it.
212+
// Retrieve the next id. We know this will be as high as we want it.
213213
$id = $this->query("SELECT nextval('" . $sequence_name . "')")->fetchField();
214214

215215
$this->query("SELECT pg_advisory_unlock(" . POSTGRESQL_NEXTID_LOCK . ")");

includes/database/pgsql/install.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class DatabaseTasks_pgsql extends DatabaseTasks {
165165
LANGUAGE \'sql\''
166166
);
167167

168-
// Using || to concatenate in Drupal is not recommeneded because there are
168+
// Using || to concatenate in Drupal is not recommended because there are
169169
// database drivers for Drupal that do not support the syntax, however
170170
// they do support CONCAT(item1, item2) which we can replicate in
171171
// PostgreSQL. PostgreSQL requires the function to be defined for each

includes/database/pgsql/select.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class SelectQuery_pgsql extends SelectQuery {
8080
}
8181

8282
// If a table loads all fields, it can not be added again. It would
83-
// result in an ambigious alias error because that field would be loaded
83+
// result in an ambiguous alias error because that field would be loaded
8484
// twice: Once through table_alias.* and once directly. If the field
8585
// actually belongs to a different table, it must be added manually.
8686
foreach ($this->tables as $table) {
@@ -90,7 +90,7 @@ class SelectQuery_pgsql extends SelectQuery {
9090
}
9191

9292
// If $field contains an characters which are not allowed in a field name
93-
// it is considered an expression, these can't be handeld automatically
93+
// it is considered an expression, these can't be handled automatically
9494
// either.
9595
if ($this->connection->escapeField($field) != $field) {
9696
return $return;

includes/database/query.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,8 @@ class DeleteQuery extends Query implements QueryConditionInterface {
845845
/**
846846
* Executes the DELETE query.
847847
*
848-
* @return
849-
* The return value is dependent on the database connection.
848+
* @return int
849+
* The number of rows affected by the delete query.
850850
*/
851851
public function execute() {
852852
$values = array();
@@ -1242,7 +1242,7 @@ class UpdateQuery extends Query implements QueryConditionInterface {
12421242
* MergeQuery::updateFields() and MergeQuery::insertFields() needs to be called
12431243
* instead. MergeQuery::fields() can also be called which calls both of these
12441244
* methods as the common case is to use the same column-value pairs for both
1245-
* INSERT and UPDATE. However, this is not mandatory. Another convinient
1245+
* INSERT and UPDATE. However, this is not mandatory. Another convenient
12461246
* wrapper is MergeQuery::key() which adds the same column-value pairs to the
12471247
* condition and the INSERT query part.
12481248
*

includes/database/schema.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ require_once dirname(__FILE__) . '/query.inc';
164164
* @see drupal_install_schema()
165165
*/
166166

167+
/**
168+
* Base class for database schema definitions.
169+
*/
167170
abstract class DatabaseSchema implements QueryPlaceholderInterface {
168171

169172
protected $connection;
@@ -291,7 +294,7 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface {
291294
protected function buildTableNameCondition($table_name, $operator = '=', $add_prefix = TRUE) {
292295
$info = $this->connection->getConnectionOptions();
293296

294-
// Retrive the table name and schema
297+
// Retrieve the table name and schema
295298
$table_info = $this->getPrefixInfo($table_name, $add_prefix);
296299

297300
$condition = new DatabaseCondition('AND');

includes/database/sqlite/query.inc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,15 @@ class UpdateQuery_sqlite extends UpdateQuery {
9999

100100
/**
101101
* SQLite specific implementation of DeleteQuery.
102-
*
103-
* When the WHERE is omitted from a DELETE statement and the table being deleted
104-
* has no triggers, SQLite uses an optimization to erase the entire table content
105-
* without having to visit each row of the table individually.
106-
*
107-
* Prior to SQLite 3.6.5, SQLite does not return the actual number of rows deleted
108-
* by that optimized "truncate" optimization.
109102
*/
110103
class DeleteQuery_sqlite extends DeleteQuery {
111104
public function execute() {
105+
// When the WHERE is omitted from a DELETE statement and the table being
106+
// deleted has no triggers, SQLite uses an optimization to erase the entire
107+
// table content without having to visit each row of the table individually.
108+
// Prior to SQLite 3.6.5, SQLite does not return the actual number of rows
109+
// deleted by that optimized "truncate" optimization. But we want to return
110+
// the number of rows affected, so we calculate it directly.
112111
if (!count($this->condition)) {
113112
$total_rows = $this->connection->query('SELECT COUNT(*) FROM {' . $this->connection->escapeTable($this->table) . '}')->fetchField();
114113
parent::execute();

0 commit comments

Comments
 (0)