aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2015-04-25 17:41:17 +0200
committerAndreas Fischer <bantu@phpbb.com>2015-04-25 17:41:17 +0200
commit901875a1fb43610365817b61486409645787d39c (patch)
tree7fc7ae6401f9d8e17705de1b72918da8f20f4b77 /phpBB
parent073f3e4470016af718f90070276305615abc007f (diff)
parent463c62df1847a3791fb7ec23b72c2f72bed12938 (diff)
downloadforums-901875a1fb43610365817b61486409645787d39c.tar
forums-901875a1fb43610365817b61486409645787d39c.tar.gz
forums-901875a1fb43610365817b61486409645787d39c.tar.bz2
forums-901875a1fb43610365817b61486409645787d39c.tar.xz
forums-901875a1fb43610365817b61486409645787d39c.zip
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
Diffstat (limited to 'phpBB')
-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';