diff --git a/system/Theme.php b/system/Theme.php index 4ae728a..32e63eb 100755 --- a/system/Theme.php +++ b/system/Theme.php @@ -33,14 +33,15 @@ private static function __setThemeUri() { public static function __setHomeUri() { self::$homeUri = 'http'; + $https = false; if (isset($_SERVER['HTTPS']) && $_SERVER["HTTPS"] == "on") { - $serverProtocol .= "s"; + self::$homeUri .= "s"; + $https = true; } self::$homeUri .= "://"; - if ($_SERVER["SERVER_PORT"] != "80") { - self::$homeUri = $serverProtocol . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"]; - } else { - self::$homeUri .= $_SERVER["SERVER_NAME"]; + self::$homeUri .= $_SERVER["SERVER_NAME"]; + if ( (!$https && $_SERVER["SERVER_PORT"] != "80") || ($https && $_SERVER["SERVER_PORT"] != "443") ) { + self::$homeUri .= ":" . $_SERVER["SERVER_PORT"]; } self::$homeUri.= str_replace('/index.php', '', $_SERVER['PHP_SELF']); } @@ -144,4 +145,4 @@ public static function pagination($total = 0, $split = 10) { } } -} \ No newline at end of file +}