1、内核更新

2、可关闭手机站
This commit is contained in:
2017-01-04 19:51:59 +08:00
parent c7bdf42447
commit 77c1f9c8bf
86 changed files with 230 additions and 108 deletions

View File

@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -688,7 +688,7 @@ class Request
{
if (empty($this->post)) {
$content = $this->input;
if (empty($_POST) && strpos($content, '":')) {
if (empty($_POST) && 'application/json' == $this->contentType()) {
$this->post = (array) json_decode($content, true);
} else {
$this->post = $_POST;
@@ -713,7 +713,7 @@ class Request
{
if (is_null($this->put)) {
$content = $this->input;
if (strpos($content, '":')) {
if ('application/json' == $this->contentType()) {
$this->put = (array) json_decode($content, true);
} else {
parse_str($content, $this->put);
@@ -1348,6 +1348,21 @@ class Request
return $this->server('REMOTE_PORT');
}
/**
* 当前请求 HTTP_CONTENT_TYPE
* @access public
* @return string
*/
public function contentType()
{
$contentType = $this->server('CONTENT_TYPE');
if ($contentType) {
list($type) = explode(';', $contentType);
return trim($type);
}
return '';
}
/**
* 获取当前请求的路由信息
* @access public