修正secure判断

This commit is contained in:
祁宁 2014-10-11 10:07:41 +08:00
parent 889f27d119
commit e3a7f143eb
2 changed files with 20 additions and 20 deletions

View File

@ -24,20 +24,20 @@ a {
a:hover, a:active {
color: #444;
}
pre, code {
padding: 2px 4px;
pre, code {
background: #F3F3F0;
font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
font-size: .92857em;
}
code { color: #B94A48; }
code { padding: 2px 4px; color: #B94A48; }
pre {
padding: 8px;
padding: 0;
border: 1px solid #ccc;
overflow: auto;
max-height: 400px;
}
pre code {
padding: 0;
padding: 3px;
color: #444;
}
@ -496,4 +496,4 @@ img.alignright {
* Hide visually and from screenreaders, but maintain layout
*/
.invisible {
visibility: hidden; }
visibility: hidden; }

View File

@ -226,6 +226,19 @@ class Typecho_Request
return self::$_urlPrefix;
}
/**
* 判断是否为https
*
* @access public
* @return boolean
*/
public static function isSecure()
{
return (!empty($_SERVER['HTTPS']) && 'off' != strtolower($_SERVER['HTTPS']))
|| (!empty($_SERVER['SERVER_PORT']) && 443 == $_SERVER['SERVER_PORT'])
|| (defined('__TYPECHO_SECURE__') && __TYPECHO_SECURE__);
}
/**
* 设置过滤器
*
@ -763,20 +776,7 @@ class Typecho_Request
public function isPut()
{
return 'PUT' == $this->getServer('REQUEST_METHOD');
}
/**
* 判断是否为https
*
* @access public
* @return boolean
*/
public function isSecure()
{
return (!empty($_SERVER['HTTPS']) && 'off' != strtolower($_SERVER['HTTPS']))
|| (!empty($_SERVER['SERVER_PORT']) && 443 == $_SERVER['SERVER_PORT'])
|| (defined('__TYPECHO_SECURE__') && __TYPECHO_SECURE__);
}
}
/**
* 判断是否为ajax