Merge branch 'ticket/13765' into ticket/13765-3.1.4

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

Conflicts:
	phpBB/includes/functions.php
	phpBB/includes/startup.php
This commit is contained in:
Andreas Fischer 2015-04-25 17:41:17 +02:00
commit 901875a1fb

View file

@ -2544,13 +2544,19 @@ function phpbb_request_http_version()
{ {
global $request; global $request;
$version = '';
if ($request && $request->server('SERVER_PROTOCOL')) if ($request && $request->server('SERVER_PROTOCOL'))
{ {
return $request->server('SERVER_PROTOCOL'); $version = $request->server('SERVER_PROTOCOL');
} }
else if (isset($_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'; return 'HTTP/1.0';