diff options
Diffstat (limited to 'system/helpers/url.php')
-rw-r--r-- | system/helpers/url.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/system/helpers/url.php b/system/helpers/url.php index 014f96fe..02956fc3 100644 --- a/system/helpers/url.php +++ b/system/helpers/url.php @@ -62,7 +62,9 @@ class url_Core { if ($site_domain === '' OR $site_domain[0] === '/') { // Guess the server name if the domain starts with slash - $base_url = $protocol.'://'.($_SERVER['SERVER_NAME']?$_SERVER['SERVER_NAME']:$_SERVER['HTTP_HOST']).$site_domain; + $port = $_SERVER['SERVER_PORT']; + $port = ((($port == 80) && ($protocol == 'http')) || (($port == 443) && ($protocol == 'https')) || !$port) ? '' : ":$port"; + $base_url = $protocol.'://'.($_SERVER['SERVER_NAME']?($_SERVER['SERVER_NAME'].$port):$_SERVER['HTTP_HOST']).$site_domain; } else { |