Skip to content

Commit

Permalink
Ensure SERVER_PROTOCOL exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jdarwood007 committed Jul 31, 2023
1 parent 84e74d0 commit 3c2c400
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Subs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 3c2c400

Please sign in to comment.