mirror of
https://github.com/typecho/typecho.git
synced 2025-03-19 17:39:42 +01:00
Merge pull request #393 from tridays/master
修复检测不到 $_server['SERVER_PORT'] 导致无法访问后台的问题。
This commit is contained in:
commit
44141c5727
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user