aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2015-04-25 18:11:07 +0200
committerAndreas Fischer <bantu@phpbb.com>2015-04-25 18:11:07 +0200
commit0fc70d4b1530254ab81dfff3f0e4078eb751de0f (patch)
tree4104c17bc7d27e1a7edc11efd24ed9c3fc050c87
parent552f35952aaf992157e62148ae571bf2ab899c4a (diff)
parent901875a1fb43610365817b61486409645787d39c (diff)
downloadforums-0fc70d4b1530254ab81dfff3f0e4078eb751de0f.tar
forums-0fc70d4b1530254ab81dfff3f0e4078eb751de0f.tar.gz
forums-0fc70d4b1530254ab81dfff3f0e4078eb751de0f.tar.bz2
forums-0fc70d4b1530254ab81dfff3f0e4078eb751de0f.tar.xz
forums-0fc70d4b1530254ab81dfff3f0e4078eb751de0f.zip
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.
-rw-r--r--phpBB/includes/functions.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 573df9e55d..4fdeb12d3a 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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';