mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
Merge pull request #3550 from bantu/ticket/13765-3.1.4
[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.
This commit is contained in:
commit
0fc70d4b15
1 changed files with 8 additions and 2 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Reference in a new issue