diff --git a/Sources/Subs.php b/Sources/Subs.php index ee9f8d9161..8d62c4bb8b 100644 --- a/Sources/Subs.php +++ b/Sources/Subs.php @@ -8170,7 +8170,7 @@ function send_http_status($code, $status = '') 503 => 'Service Unavailable', ); - $protocol = preg_match('~^\s*(HTTP/[12]\.\d)\s*$~i', $_SERVER['SERVER_PROTOCOL'], $matches) ? $matches[1] : 'HTTP/1.0'; + $protocol = !empty($_SERVER['SERVER_PROTOCOL']) && preg_match('~^\s*(HTTP/[12]\.\d)\s*$~i', $_SERVER['SERVER_PROTOCOL'], $matches) ? $matches[1] : 'HTTP/1.0'; // Typically during these requests, we have cleaned the response (ob_*clean), ensure these headers exist. require_once($sourcedir . '/Security.php');