aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2016-03-27 12:56:03 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2016-03-27 12:56:03 +0200
commit5442a2596718ea2ce81dfa31c44549f62311cd47 (patch)
tree43d3ba6aba4298e155b2926d5133fb213d3ef846 /phpBB/includes/functions.php
parent50737da051bc949b71aa7516dda8bebbfe61c73c (diff)
parentf22bd4e511697bedb76c1909148753b3581adb1f (diff)
downloadforums-5442a2596718ea2ce81dfa31c44549f62311cd47.tar
forums-5442a2596718ea2ce81dfa31c44549f62311cd47.tar.gz
forums-5442a2596718ea2ce81dfa31c44549f62311cd47.tar.bz2
forums-5442a2596718ea2ce81dfa31c44549f62311cd47.tar.xz
forums-5442a2596718ea2ce81dfa31c44549f62311cd47.zip
Merge pull request #4182 from marc1706/ticket/14481
[ticket/14481] Respect HTTP_X_FORWARDED headers for implying https * marc1706/ticket/14481: [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/functions.php')
-rw-r--r--phpBB/includes/functions.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 8e3f62230a..b225effacc 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2234,6 +2234,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)