diff options
| author | Matthew Noorenberghe <github@matthew.noorenberghe.com> | 2013-12-29 18:12:08 -0500 |
|---|---|---|
| committer | Matthew Noorenberghe <github@matthew.noorenberghe.com> | 2013-12-29 18:18:09 -0500 |
| commit | 6d3590132bd859cbf4ba4c4930931c5b18ae1589 (patch) | |
| tree | 7438d9ba046cc4b6c6d128d9b10f8d3301ca6915 | |
| parent | c9b262f3d7182668f51cb74182f019e1c5019729 (diff) | |
| download | webtrees-6d3590132bd859cbf4ba4c4930931c5b18ae1589.tar.gz webtrees-6d3590132bd859cbf4ba4c4930931c5b18ae1589.tar.bz2 webtrees-6d3590132bd859cbf4ba4c4930931c5b18ae1589.zip | |
Don't include the port for HTTPS in WT_SERVER_NAME when it's the default of 443
| -rwxr-xr-x | includes/session.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/session.php b/includes/session.php index 70cfd5be6e..edf6f5a3dc 100755 --- a/includes/session.php +++ b/includes/session.php @@ -165,10 +165,11 @@ if (!ini_get('date.timezone')) { // TODO: we ought to generate this dynamically, but lots of code currently relies on this global $QUERY_STRING=isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; +$https = !empty($_SERVER['HTTPS']) && in_array($_SERVER['HTTPS'], array('1', 'on', 'On', 'ON')); define('WT_SERVER_NAME', - (empty($_SERVER['HTTPS']) || !in_array($_SERVER['HTTPS'], array('1', 'on', 'On', 'ON')) ? 'http://' : 'https://'). + ($https ? 'https://' : 'http://'). (empty($_SERVER['SERVER_NAME']) ? '' : $_SERVER['SERVER_NAME']). - (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT']==80 ? '' : ':'.$_SERVER['SERVER_PORT']) + (empty($_SERVER['SERVER_PORT']) || (!$https && $_SERVER['SERVER_PORT']==80) || ($https && $_SERVER['SERVER_PORT']==443) ? '' : ':'.$_SERVER['SERVER_PORT']) ); // SCRIPT_NAME should always be correct, but is not always present. |
