diff options
author | Andreas Fischer <bantu@phpbb.com> | 2015-04-25 18:11:19 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2015-04-25 18:11:19 +0200 |
commit | 80d4fb1847b4e92cc931e02a90f09e1fa2735500 (patch) | |
tree | 2ddcba422aa313c6aef23438c506c46c5a233728 /phpBB | |
parent | 746a33b57bf9bba645c826b596fbc54ee13d1954 (diff) | |
parent | 196eb98ba8abe66cefa87de86ec506a6024280d7 (diff) | |
download | forums-80d4fb1847b4e92cc931e02a90f09e1fa2735500.tar forums-80d4fb1847b4e92cc931e02a90f09e1fa2735500.tar.gz forums-80d4fb1847b4e92cc931e02a90f09e1fa2735500.tar.bz2 forums-80d4fb1847b4e92cc931e02a90f09e1fa2735500.tar.xz forums-80d4fb1847b4e92cc931e02a90f09e1fa2735500.zip |
Merge branch '3.1.x'
* 3.1.x:
[ticket/13765] Verify SERVER_PROTOCOL has the expected format before using it.
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 957b475616..3828fde1ce 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1975,13 +1975,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'; |