Merge pull request #3549 from bantu/ticket/13765

[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.

* bantu/ticket/13765:
  [ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
This commit is contained in:
Andreas Fischer 2015-04-25 18:10:45 +02:00
commit 4d63032024
2 changed files with 2 additions and 2 deletions

View file

@ -2782,7 +2782,7 @@ function send_status_line($code, $message)
} }
else else
{ {
if (!empty($_SERVER['SERVER_PROTOCOL'])) if (!empty($_SERVER['SERVER_PROTOCOL']) && is_string($_SERVER['SERVER_PROTOCOL']) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $_SERVER['SERVER_PROTOCOL']))
{ {
$version = $_SERVER['SERVER_PROTOCOL']; $version = $_SERVER['SERVER_PROTOCOL'];
} }

View file

@ -130,7 +130,7 @@ if (phpbb_has_trailing_path($phpEx))
{ {
$prefix = 'Status:'; $prefix = 'Status:';
} }
else if (!empty($_SERVER['SERVER_PROTOCOL'])) else if (!empty($_SERVER['SERVER_PROTOCOL']) && is_string($_SERVER['SERVER_PROTOCOL']) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $_SERVER['SERVER_PROTOCOL']))
{ {
$prefix = $_SERVER['SERVER_PROTOCOL']; $prefix = $_SERVER['SERVER_PROTOCOL'];
} }