From d4e29a91b6b84b4c18135c4da49622892e38bd89 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 22 Sep 2011 13:46:26 +1200 Subject: [PATCH] $_SERVERS['SERVER_PORT'] might not be set in some circumstances. --- htdocs/always.php | 6 ++++-- inc/always.php.in | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/always.php b/htdocs/always.php index 662fca72..9f356778 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -109,8 +109,10 @@ $c->protocol_server_port = sprintf( '%s://%s%s', (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'? 'https' : 'http'), $_SERVER['SERVER_NAME'], ( - ( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') && $_SERVER['SERVER_PORT'] == 80 ) - || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] == 443 ) + ( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') + && (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80) ) + || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' + && (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 443) ) ? '' : ':'.$_SERVER['SERVER_PORT'] ) ); diff --git a/inc/always.php.in b/inc/always.php.in index 8b5f4eb8..39bc4cbd 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -109,8 +109,10 @@ $c->protocol_server_port = sprintf( '%s://%s%s', (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'? 'https' : 'http'), $_SERVER['SERVER_NAME'], ( - ( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') && $_SERVER['SERVER_PORT'] == 80 ) - || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] == 443 ) + ( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') + && (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80) ) + || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' + && (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 443) ) ? '' : ':'.$_SERVER['SERVER_PORT'] ) );