Verified Commit 2464f113 authored by Juraj Nemec's avatar Juraj Nemec
Browse files

Issue #3276848 by DamienMcKenna: run-tests.sh gives "Deprecated:...

Issue #3276848 by DamienMcKenna: run-tests.sh gives "Deprecated: str_replace(): Passing null to parameter" with PHP 8.0
parent 13472d3c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -328,9 +328,13 @@ function simpletest_script_init($server_software) {
  if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    // Ensure that any and all environment variables are changed to https://.
    foreach ($_SERVER as $key => $value) {
      // The first time this script runs $_SERVER['SERVER_SOFTWARE'] will be
      // NULL, so avoid errors from str_replace().
      if (!empty($_SERVER[$key])) {
        $_SERVER[$key] = str_replace('http://', 'https://', $_SERVER[$key]);
      }
    }
  }

  chdir(realpath(dirname(__FILE__) . '/..'));
  define('DRUPAL_ROOT', getcwd());