diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2016-02-15 21:40:52 +0100 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2016-02-15 22:06:25 +0100 |
| commit | accf8f8625ca1c730ee0bb09e1ecc44526c124d3 (patch) | |
| tree | d99ca148a268002187c1637e8762fcdef9e45c21 /phpBB/common.php | |
| parent | 17e21d5140ccb99363a32bd64c32af6012c1ce97 (diff) | |
| download | forums-accf8f8625ca1c730ee0bb09e1ecc44526c124d3.tar forums-accf8f8625ca1c730ee0bb09e1ecc44526c124d3.tar.gz forums-accf8f8625ca1c730ee0bb09e1ecc44526c124d3.tar.bz2 forums-accf8f8625ca1c730ee0bb09e1ecc44526c124d3.tar.xz forums-accf8f8625ca1c730ee0bb09e1ecc44526c124d3.zip | |
[ticket/14481] Respect HTTP_X_FORWARDED headers for implying https
PHPBB3-14481
Diffstat (limited to 'phpBB/common.php')
| -rw-r--r-- | phpBB/common.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index 0782bd7321..71d501e926 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -38,7 +38,13 @@ if (!defined('PHPBB_INSTALLED')) // available as used by the redirect function $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'); - $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; + $secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 1 : 0; + + if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') + { + $secure = 1; + $server_port = 443; + } $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); if (!$script_name) |
