aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_url.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions_url.inc.php')
-rw-r--r--include/functions_url.inc.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 787c06780..56ea858e1 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -51,9 +51,11 @@ function get_absolute_root_url($with_scheme=true)
$url = '';
if ($with_scheme)
{
+ $is_https = false;
if (isset($_SERVER['HTTPS']) &&
- ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
+ ((strtolower($_SERVER['HTTPS']) == 'on') or ($_SERVER['HTTPS'] == 1)))
{
+ $is_https = true;
$url .= 'https://';
}
else
@@ -61,7 +63,8 @@ function get_absolute_root_url($with_scheme=true)
$url .= 'http://';
}
$url .= $_SERVER['HTTP_HOST'];
- if ($_SERVER['SERVER_PORT'] != 80)
+ if ( (!$is_https && $_SERVER['SERVER_PORT'] != 80)
+ ||($is_https && $_SERVER['SERVER_PORT'] != 443))
{
$url_port = ':'.$_SERVER['SERVER_PORT'];
if (strrchr($url, ':') != $url_port)