Skip to content

Commit

Permalink
Merge pull request phpbb#3550 from bantu/ticket/13765-3.1.4
Browse files Browse the repository at this point in the history
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.

* bantu/ticket/13765-3.1.4:
  [ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
  • Loading branch information
bantu committed Apr 25, 2015
2 parents 073f3e4 + 901875a commit eae5926
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions phpBB/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2544,13 +2544,19 @@ function phpbb_request_http_version()
{
global $request;

$version = '';
if ($request && $request->server('SERVER_PROTOCOL'))
{
return $request->server('SERVER_PROTOCOL');
$version = $request->server('SERVER_PROTOCOL');
}
else if (isset($_SERVER['SERVER_PROTOCOL']))
{
return $_SERVER['SERVER_PROTOCOL'];
$version = $_SERVER['SERVER_PROTOCOL'];
}

if (!empty($version) && is_string($version) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $version))
{
return $version;
}

return 'HTTP/1.0';
Expand Down

0 comments on commit eae5926

Please sign in to comment.