Commit 64581a54 authored by catch's avatar catch
Browse files

Issue #3279289 by rizzie, claudiu.cristea, Berdir, cilefen:...

Issue #3279289 by rizzie, claudiu.cristea, Berdir, cilefen: file_requirements() can trigger a PHP 8.1 deprecation notice when called without a SERVER_SOFTWARE server env variable

(cherry picked from commit 784ee657)
parent 0f10593e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -69,7 +69,9 @@ function file_requirements($phase) {
  if ($phase == 'runtime') {
    $description = NULL;
    $implementation = file_progress_implementation();
    $server_software = \Drupal::request()->server->get('SERVER_SOFTWARE');
    // The environment variable might be missing. Fallback to an empty string to
    // prevent passing NULL to preg_match(), a few lines later.
    $server_software = \Drupal::request()->server->get('SERVER_SOFTWARE', '');

    // Test the web server identity.
    if (preg_match("/Nginx/i", $server_software)) {