diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-03-27 12:56:03 +0200 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-03-27 12:56:03 +0200 |
commit | 386d31ec635c8e45d769706d2bf9e72f4aab46f0 (patch) | |
tree | 046b98e70e41ca08735a20a685c01d9d9efae74a /phpBB/includes | |
parent | 7d5a853b21a5be53d0364f1e02a9cddfc789a5fb (diff) | |
parent | 5442a2596718ea2ce81dfa31c44549f62311cd47 (diff) | |
download | forums-386d31ec635c8e45d769706d2bf9e72f4aab46f0.tar forums-386d31ec635c8e45d769706d2bf9e72f4aab46f0.tar.gz forums-386d31ec635c8e45d769706d2bf9e72f4aab46f0.tar.bz2 forums-386d31ec635c8e45d769706d2bf9e72f4aab46f0.tar.xz forums-386d31ec635c8e45d769706d2bf9e72f4aab46f0.zip |
Merge branch '3.1.x' into 3.2.x
* 3.1.x:
[ticket/14481] Add tests for x_forwarded_proto header
[ticket/14481] Use port 443 if https is specified in x-forwarded-proto
[ticket/14481] Respect HTTP_X_FORWARDED headers for implying https
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 10788d0d6a..497403b1e5 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1648,6 +1648,12 @@ function generate_board_url($without_script_path = false) $server_name = $user->host; $server_port = $request->server('SERVER_PORT', 0); + $forwarded_proto = $request->server('HTTP_X_FORWARDED_PROTO'); + + if (!empty($forwarded_proto) && $forwarded_proto === 'https') + { + $server_port = 443; + } // Forcing server vars is the only way to specify/override the protocol if ($config['force_server_vars'] || !$server_name) |