Commit 21689a39 authored by catch's avatar catch
Browse files

Issue #3180998 by anmolgoyal74, alexpott: Remove dead code due to minimum PHP version

parent 944bcb1e
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
@@ -1144,34 +1144,6 @@ function system_requirements($phase) {
    }
  }

  // Warning for httpoxy on IIS with affected PHP versions
  // @see https://www.drupal.org/node/2783079
  if (strpos($software, 'Microsoft-IIS') !== FALSE && version_compare(PHP_VERSION, '7.0.9', '<')) {
    $dom = new \DOMDocument('1.0', 'UTF-8');
    $webconfig = file_get_contents('web.config');
    // If you are here the web.config file must - of course - be well formed.
    // But the PHP DOM component will throw warnings on some XML compliant
    // stuff, so silently parse the configuration file.
    @$dom->loadHTML($webconfig);
    $httpoxy_rewrite = FALSE;
    foreach ($dom->getElementsByTagName('rule') as $rule) {
      foreach ($rule->attributes as $attr) {
        if (@$attr->name == 'name' && @$attr->nodeValue == 'Erase HTTP_PROXY') {
          $httpoxy_rewrite = TRUE;
          break 2;
        }
      }
    }
    if (!$httpoxy_rewrite) {
      $requirements['iis_httpoxy_protection'] = [
        'title' => t('IIS httpoxy protection'),
        'value' => t('Your PHP runtime version is affected by the httpoxy vulnerability.'),
        'description' => t('Either update your PHP runtime version or uncomment the "Erase HTTP_PROXY" rule in your web.config file and add HTTP_PROXY to the allowed headers list. See more details in the <a href=":link">security advisory</a>.', [':link' => 'https://www.drupal.org/SA-CORE-2016-003']),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }

  // Installations on Windows can run into limitations with MAX_PATH if the
  // Drupal root directory is too deep in the filesystem. Generally this shows
  // up in cached Twig templates and other public files with long directory or
+0 −11
Original line number Diff line number Diff line
@@ -18,17 +18,6 @@
  return;
}

if (version_compare(PHP_VERSION, '5.4.5') < 0) {
  $version = PHP_VERSION;
  echo <<<EOF

ERROR: This script requires at least PHP version 5.4.5. You invoked it with
       PHP version {$version}.
\n
EOF;
  exit;
}

$script = basename(array_shift($_SERVER['argv']));

if (in_array('--help', $_SERVER['argv']) || empty($_SERVER['argv'])) {
+1 −6
Original line number Diff line number Diff line
@@ -136,12 +136,7 @@ public function testUncaughtExceptionCustomExceptionHandler() {
   * Tests a missing dependency on a service.
   */
  public function testMissingDependency() {
    if (version_compare(PHP_VERSION, '7.1') < 0) {
      $this->expectedExceptionMessage = 'Argument 1 passed to Drupal\error_service_test\LonelyMonkeyClass::__construct() must be an instance of Drupal\Core\Database\Connection, non';
    }
    else {
    $this->expectedExceptionMessage = 'Too few arguments to function Drupal\error_service_test\LonelyMonkeyClass::__construct(), 0 passed';
    }
    $this->drupalGet('broken-service-class');
    $this->assertSession()->statusCodeEquals(500);