This commit is contained in:
祁宁
2014-10-11 00:11:32 +08:00
parent aa6e27b95d
commit 889f27d119
+1 -4
View File
@@ -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']);
}