aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2016-10-24 23:08:09 +0200
committerTristan Darricau <github@nicofuma.fr>2016-10-24 23:08:09 +0200
commitb8ef36ddb1b141ad71bd88a2edb8ac088f9b9b74 (patch)
treeacd45e65d35bf9f205e0ff21de3d415791d08105 /phpBB/includes/functions.php
parentb13910ee45fc5c2985d00b2a8166489b2fc58bec (diff)
parente3a85ff0a741549815224f962f87748818ed1b9e (diff)
downloadforums-b8ef36ddb1b141ad71bd88a2edb8ac088f9b9b74.tar
forums-b8ef36ddb1b141ad71bd88a2edb8ac088f9b9b74.tar.gz
forums-b8ef36ddb1b141ad71bd88a2edb8ac088f9b9b74.tar.bz2
forums-b8ef36ddb1b141ad71bd88a2edb8ac088f9b9b74.tar.xz
forums-b8ef36ddb1b141ad71bd88a2edb8ac088f9b9b74.zip
Merge branch '3.1.x' into 3.2.x
* 3.1.x: [ticket/14818] Optimize generate_board_url function
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 61573c0cc9..bbd3e524cc 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1647,13 +1647,6 @@ function generate_board_url($without_script_path = false)
global $config, $user, $request;
$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)
@@ -1668,6 +1661,13 @@ function generate_board_url($without_script_path = false)
}
else
{
+ $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;
+ }
// Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection
$cookie_secure = $request->is_secure() ? 1 : 0;
$url = (($cookie_secure) ? 'https://' : 'http://') . $server_name;