diff --git a/var/Typecho/Request.php b/var/Typecho/Request.php index 626678d2..68f0e3b3 100644 --- a/var/Typecho/Request.php +++ b/var/Typecho/Request.php @@ -218,10 +218,7 @@ class Typecho_Request public static function getUrlPrefix() { if (empty(self::$_urlPrefix)) { - $isSecure = (!empty($_SERVER['HTTPS']) && 'off' != strtolower($_SERVER['HTTPS'])) - || (!empty($_SERVER['SERVER_PORT']) && 443 == $_SERVER['SERVER_PORT']); - - self::$_urlPrefix = ($isSecure ? 'https' : 'http') + self::$_urlPrefix = (self::isSecure() ? 'https' : 'http') . '://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']) . (in_array($_SERVER['SERVER_PORT'], array(80, 443)) ? '' : ':' . $_SERVER['SERVER_PORT']); }