From 79f51a1478530aae17f9bcf5f17645b44dbc14cd Mon Sep 17 00:00:00 2001 From: "stefan.r" Date: Wed, 1 Feb 2017 16:37:14 -0500 Subject: [PATCH 01/29] Back to 7.x-dev --- CHANGELOG.txt | 3 +++ includes/bootstrap.inc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c015fb4fa2b..76c2e693937 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,7 @@ +Drupal 7.xx, xxxx-xx-xx (development version) +----------------------- + Drupal 7.54, 2017-02-01 ----------------------- - Modules are now able to define theme engines (API addition: diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 99a5ac84dcf..36bd0facd16 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -8,7 +8,7 @@ /** * The current system version. */ -define('VERSION', '7.54'); +define('VERSION', '7.55-dev'); /** * Core API compatibility. From 8008df236b80de0f202fd65537efb921fc5d528f Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Thu, 1 Jun 2017 19:02:31 -0400 Subject: [PATCH 02/29] Issue #2877243 by David_Rothstein, karoop, joseph.olstad, deminy: DATE_RFC7231 already defined in PHP 7.0.19 and 7.1.5 --- CHANGELOG.txt | 2 ++ includes/bootstrap.inc | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 76c2e693937..7bd2405dbf6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.xx, xxxx-xx-xx (development version) ----------------------- +- Fixed incompatibility with PHP versions 7.0.19 and 7.1.5 due to duplicate + DATE_RFC7231 definition. Drupal 7.54, 2017-02-01 ----------------------- diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 36bd0facd16..755c74f84f1 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -254,8 +254,13 @@ define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' * http://tools.ietf.org/html/rfc7231#section-7.1.1.1 * * Example: Sun, 06 Nov 1994 08:49:37 GMT + * + * This constant was introduced in PHP 7.0.19 and PHP 7.1.5 but needs to be + * defined by Drupal for earlier PHP versions. */ -define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T'); +if (!defined('DATE_RFC7231')) { + define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T'); +} /** * Provides a caching wrapper to be used in place of large array structures. From 370fd890d80232166edf1f286e367f9e771c0bbb Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Thu, 1 Jun 2017 19:06:24 -0400 Subject: [PATCH 03/29] Issue #2880700 by David_Rothstein, cilefen, mpdonadio, xjm, Mile23: UserTimeZoneFunctionalTest fails on recent versions of PHP 7 and 7.1 --- modules/user/user.test | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/user/user.test b/modules/user/user.test index 63143c3ced9..8500bad3a4b 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -1529,7 +1529,13 @@ class UserTimeZoneFunctionalTest extends DrupalWebTestCase { // Setup date/time settings for Los Angeles time. variable_set('date_default_timezone', 'America/Los_Angeles'); variable_set('configurable_timezones', 1); - variable_set('date_format_medium', 'Y-m-d H:i T'); + + // Override the 'medium' date format, which is the default for node + // creation time. Since we are testing time zones with Daylight Saving + // Time, and need to future proof against changes to the zoneinfo database, + // we choose the 'I' format placeholder instead of a human-readable zone + // name. With 'I', a 1 means the date is in DST, and 0 if not. + variable_set('date_format_medium', 'Y-m-d H:i I'); // Create a user account and login. $web_user = $this->drupalCreateUser(); @@ -1547,11 +1553,11 @@ class UserTimeZoneFunctionalTest extends DrupalWebTestCase { // Confirm date format and time zone. $this->drupalGet("node/$node1->nid"); - $this->assertText('2007-03-09 21:00 PST', 'Date should be PST.'); + $this->assertText('2007-03-09 21:00 0', 'Date should be PST.'); $this->drupalGet("node/$node2->nid"); - $this->assertText('2007-03-11 01:00 PST', 'Date should be PST.'); + $this->assertText('2007-03-11 01:00 0', 'Date should be PST.'); $this->drupalGet("node/$node3->nid"); - $this->assertText('2007-03-20 21:00 PDT', 'Date should be PDT.'); + $this->assertText('2007-03-20 21:00 1', 'Date should be PDT.'); // Change user time zone to Santiago time. $edit = array(); @@ -1562,11 +1568,11 @@ class UserTimeZoneFunctionalTest extends DrupalWebTestCase { // Confirm date format and time zone. $this->drupalGet("node/$node1->nid"); - $this->assertText('2007-03-10 02:00 CLST', 'Date should be Chile summer time; five hours ahead of PST.'); + $this->assertText('2007-03-10 02:00 1', 'Date should be Chile summer time; five hours ahead of PST.'); $this->drupalGet("node/$node2->nid"); - $this->assertText('2007-03-11 05:00 CLT', 'Date should be Chile time; four hours ahead of PST'); + $this->assertText('2007-03-11 05:00 0', 'Date should be Chile time; four hours ahead of PST'); $this->drupalGet("node/$node3->nid"); - $this->assertText('2007-03-21 00:00 CLT', 'Date should be Chile time; three hours ahead of PDT.'); + $this->assertText('2007-03-21 00:00 0', 'Date should be Chile time; three hours ahead of PDT.'); } } From 1531198741e170a5aff02c93ea302409b4b2e6e4 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Thu, 1 Jun 2017 19:13:52 -0400 Subject: [PATCH 04/29] Issue #2850773 by alexpott: Fix tempnam() usage in PHP 7.1 --- modules/locale/locale.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/locale/locale.test b/modules/locale/locale.test index 6fcf06fe5e6..db87e05548c 100644 --- a/modules/locale/locale.test +++ b/modules/locale/locale.test @@ -819,7 +819,7 @@ class LocalePluralFormatTest extends DrupalWebTestCase { * Additional options to pass to the translation import form. */ function importPoFile($contents, array $options = array()) { - $name = tempnam('temporary://', "po_") . '.po'; + $name = drupal_tempnam('temporary://', "po_") . '.po'; file_put_contents($name, $contents); $options['files[file]'] = $name; $this->drupalPost('admin/config/regional/translate/import', $options, t('Import')); @@ -1113,7 +1113,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase { * Additional options to pass to the translation import form. */ function importPoFile($contents, array $options = array()) { - $name = tempnam('temporary://', "po_") . '.po'; + $name = drupal_tempnam('temporary://', "po_") . '.po'; file_put_contents($name, $contents); $options['files[file]'] = $name; $this->drupalPost('admin/config/regional/translate/import', $options, t('Import')); @@ -1340,7 +1340,7 @@ class LocaleExportFunctionalTest extends DrupalWebTestCase { function testExportTranslation() { // First import some known translations. // This will also automatically enable the 'fr' language. - $name = tempnam('temporary://', "po_") . '.po'; + $name = drupal_tempnam('temporary://', "po_") . '.po'; file_put_contents($name, $this->getPoFile()); $this->drupalPost('admin/config/regional/translate/import', array( 'langcode' => 'fr', From f73b791a2ff6e45b1da1bba9e4891b93257a76b1 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Fri, 2 Jun 2017 17:10:14 -0400 Subject: [PATCH 05/29] Issue #2847325 by sammuell, John Morahan, mfb, sanduhrs, D34dMan, C_Logemann, xumepadismal, serg2, walterebert, David Grudl: Support RFC 5785 on Apache by whitelisting the .well-known directory --- .htaccess | 4 ++-- CHANGELOG.txt | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index 440cabc6de0..3d6c2dd4418 100644 --- a/.htaccess +++ b/.htaccess @@ -3,7 +3,7 @@ # # Protect files and directories from prying eyes. - + Order allow,deny @@ -80,7 +80,7 @@ DirectoryIndex index.php index.html index.htm # If you do not have mod_rewrite installed, you should remove these # directories from your webroot or otherwise protect them from being # downloaded. - RewriteRule "(^|/)\." - [F] + RewriteRule "/\.|^\.(?!well-known/)" - [F] # If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7bd2405dbf6..8963a898d29 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,9 @@ Drupal 7.xx, xxxx-xx-xx (development version) ----------------------- - Fixed incompatibility with PHP versions 7.0.19 and 7.1.5 due to duplicate DATE_RFC7231 definition. +- Allowed services such as Let's Encrypt to work with Drupal on Apache, by + making Drupal's .htaccess file allow access to the .well-known directory + defined by RFC 5785. Drupal 7.54, 2017-02-01 ----------------------- From c55fe935e5c6dfc629c0a74d07d4c1d880f460eb Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Fri, 2 Jun 2017 17:27:35 -0400 Subject: [PATCH 06/29] Issue #2819787 by chiranjeeb2410, shashikant_chauhan, stefan.r, Kartagis, naveenvalecha: The install message referencing insufficient PDO drivers links to the wrong documentation page --- modules/system/system.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/system.install b/modules/system/system.install index ae55b892fed..d5e67435d8d 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -160,7 +160,7 @@ function system_requirements($phase) { if (empty($drivers)) { $database_ok = FALSE; $pdo_message = $t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that Drupal supports.', array( - '@drupal-databases' => 'http://drupal.org/node/270#database', + '@drupal-databases' => 'https://www.drupal.org/requirements/database', )); } // Make sure the native PDO extension is available, not the older PEAR From 833779ebf54b5ad16398bdc184ddd3ba79be18e1 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Fri, 2 Jun 2017 17:31:22 -0400 Subject: [PATCH 07/29] Issue #1886868 by IRuslan, zvse: Unused $original_destination variable in file_unmanaged_copy() --- includes/file.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/file.inc b/includes/file.inc index de9d17d6916..7157ea90164 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -889,7 +889,6 @@ function file_valid_uri($uri) { */ function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXISTS_RENAME) { $original_source = $source; - $original_destination = $destination; // Assert that the source file actually exists. if (!file_exists($source)) { From 950e45648154241f503f577bd76ecbbb7a9b8c74 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Fri, 2 Jun 2017 17:33:13 -0400 Subject: [PATCH 08/29] Issue #2851665 by tameeshb: In the database schema.inc file, the class DatabaseSchema has no class documentation block --- includes/database/schema.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/database/schema.inc b/includes/database/schema.inc index d8344c62696..8461350730f 100644 --- a/includes/database/schema.inc +++ b/includes/database/schema.inc @@ -164,6 +164,9 @@ require_once dirname(__FILE__) . '/query.inc'; * @see drupal_install_schema() */ +/** + * Base class for database schema definitions. + */ abstract class DatabaseSchema implements QueryPlaceholderInterface { protected $connection; From 5abd299fb91a91361626f1c1362be03e4c6b2a1b Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Fri, 2 Jun 2017 17:38:40 -0400 Subject: [PATCH 09/29] Issue #1854074 by jp.stacey, jhodgdon, kiwimind: Docblock in field.tpl.php needs clarification in its reference to theme_field --- modules/field/theme/field.tpl.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php index f0f9d583ffe..460fd2e266e 100644 --- a/modules/field/theme/field.tpl.php +++ b/modules/field/theme/field.tpl.php @@ -4,8 +4,10 @@ * @file field.tpl.php * Default template implementation to display the value of a field. * - * This file is not used and is here as a starting point for customization only. - * @see theme_field() + * This file is not used by Drupal core, which uses theme functions instead for + * performance reasons. The markup is the same, though, so if you want to use + * template files rather than functions to extend field theming, copy this to + * your custom theme. See theme_field() for a discussion of performance. * * Available variables: * - $items: An array of field values. Use render() to output them. @@ -45,7 +47,7 @@ */ ?>