diff --git a/var/Typecho/Request.php b/var/Typecho/Request.php index dc5309ee..8d710372 100644 --- a/var/Typecho/Request.php +++ b/var/Typecho/Request.php @@ -218,11 +218,9 @@ class Typecho_Request public static function getUrlPrefix() { if (empty(self::$_urlPrefix)) { - 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'])) - ); + self::$_urlPrefix = (self::isSecure() ? 'https' : 'http') . '://' + . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']) + . (empty($_SERVER['SERVER_PORT']) || in_array($_SERVER['SERVER_PORT'], array(80, 443)) ? '' : ':' . $_SERVER['SERVER_PORT']); } return self::$_urlPrefix;