1、内核更新
2、可关闭手机站
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user