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 | 5442a2596718ea2ce81dfa31c44549f62311cd47 (patch) | |
tree | 43d3ba6aba4298e155b2926d5133fb213d3ef846 /phpBB/phpbb/auth | |
parent | 50737da051bc949b71aa7516dda8bebbfe61c73c (diff) | |
parent | f22bd4e511697bedb76c1909148753b3581adb1f (diff) | |
download | forums-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/phpbb/auth')
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/oauth.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index be0fbf5831..9f6345fbba 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -271,7 +271,13 @@ class oauth extends \phpbb\auth\provider\base } $uri_factory = new \OAuth\Common\Http\Uri\UriFactory(); - $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(\phpbb\request\request_interface::SERVER)); + $super_globals = $this->request->get_super_global(\phpbb\request\request_interface::SERVER); + if (!empty($super_globals['HTTP_X_FORWARDED_PROTO']) && $super_globals['HTTP_X_FORWARDED_PROTO'] === 'https') + { + $super_globals['HTTPS'] = 'on'; + $super_globals['SERVER_PORT'] = 443; + } + $current_uri = $uri_factory->createFromSuperGlobalArray($super_globals); $current_uri->setQuery($query); $this->current_uri = $current_uri; |