Problem/Motivation

Somehow when merging 7.62 back to dev the changes to include/bootstrap.inc are not included.

\StreamWrapperTest::testPharStreamWrapperRegistration and \StreamWrapperTest::testPharFile are failing because of this.

Proposed resolution

Add them back - this will fix the tests.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3026529-2.patch980 bytesalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Title: Phar tests are failing on Drupal 7 » 7.x does not have Phar protection and Phar tests are failing on Drupal 7
Status: Active » Needs review
StatusFileSize
new980 bytes

I guess this happened because bootstrap.inc contains the version constant that needs adjusting.

alexpott’s picture

Atm if you do git diff 7.63...7.x includes/bootstrap.inc

diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index c17dfd2e84..250e5f9f45 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.63');
+define('VERSION', '7.64-dev');
 
 /**
  * Core API compatibility.
@@ -704,19 +704,6 @@ function drupal_environment_initialize() {
   // Set sane locale settings, to ensure consistent string, dates, times and
   // numbers handling.
   setlocale(LC_ALL, 'C');
-
-  // PHP's built-in phar:// stream wrapper is not sufficiently secure. Override
-  // it with a more secure one, which requires PHP 5.3.3. For lower versions,
-  // unregister the built-in one without replacing it. Sites needing phar
-  // support for lower PHP versions must implement hook_stream_wrappers() to
-  // register their desired implementation.
-  if (in_array('phar', stream_get_wrappers(), TRUE)) {
-    stream_wrapper_unregister('phar');
-    if (version_compare(PHP_VERSION, '5.3.3', '>=')) {
-      include_once DRUPAL_ROOT . '/includes/file.phar.inc';
-      file_register_phar_wrapper();
-    }
-  }
 }
 
 /**

This patch fixes that.

  • Fabianx committed 80b00d1 on 7.x
    Issue #3026529 by alexpott: 7.x does not have Phar protection and Phar...
fabianx’s picture

Status: Needs review » Fixed

RTBC and fixed

Thanks, Alex!

xjm’s picture

Title: 7.x does not have Phar protection and Phar tests are failing on Drupal 7 » 7.x HEAD does not have Phar protection (7.63 and lower do) and Phar tests are failing on Drupal 7

Well thank you test suite for failing and absolutely legitimately telling us that the fix was broken in HEAD.

This happened because of the way merge conflicts are resolved by the tagging script; for Drupal 8 it's never mattered because Drupal.php is not our first choice as a place to add new code, but since bootstrap.inc is if memory serves like 3000 lines of code, I've put a check on the script to bail if there are changes on either file.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.