summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-03-11 16:45:50 -0700
committerBharat Mediratta <bharat@menalto.com>2013-03-11 16:45:50 -0700
commitf49ce6542a60ac4e4001d34187769200257248a3 (patch)
treef36cc9e046830e29bd935c2bba46be97afd7ccb3
parentb10d175d9c31200c2b87d281585f1c24a0bf238c (diff)
parent63e5dd76d989c97f944c1cf0650f659bc5a40140 (diff)
Merge pull request #201 from shadlaws/fix_2049
#2049 - Fix issues with ports other than http/80 or https/443.
-rw-r--r--system/helpers/url.php4
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
{