diff options
| author | Greg Roach <fisharebest@gmail.com> | 2013-12-30 14:01:41 -0800 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2013-12-30 14:01:41 -0800 |
| commit | a8b37b398de0108b5cd30f2ca8903fa653e5969f (patch) | |
| tree | 18cdae4b719812054149f279d51b012344a80ffe | |
| parent | 0d305f571d070e04a69b267d0d2ab934f95b988b (diff) | |
| parent | 6d3590132bd859cbf4ba4c4930931c5b18ae1589 (diff) | |
| download | webtrees-a8b37b398de0108b5cd30f2ca8903fa653e5969f.tar.gz webtrees-a8b37b398de0108b5cd30f2ca8903fa653e5969f.tar.bz2 webtrees-a8b37b398de0108b5cd30f2ca8903fa653e5969f.zip | |
Merge pull request #67 from mnoorenberghe/https_port
Don't include the HTTPS port in WT_SERVER_NAME when it's the default
| -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. |
