内核更新

This commit is contained in:
2017-03-16 12:03:34 +08:00
parent b355535009
commit a4d58f9f09
28 changed files with 438 additions and 217 deletions

View File

@@ -633,7 +633,7 @@ class Request
if (true === $name) {
// 获取包含文件上传信息的数组
$file = $this->file();
$data = array_merge($this->param, $file);
$data = is_array($file) ? array_merge($this->param, $file) : $this->param;
return $this->input($data, '', $default, $filter);
}
return $this->input($this->param, $name, $default, $filter);
@@ -688,7 +688,7 @@ class Request
{
if (empty($this->post)) {
$content = $this->input;
if (empty($_POST) && 'application/json' == $this->contentType()) {
if (empty($_POST) && false !== strpos($this->contentType(), 'application/json')) {
$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 ('application/json' == $this->contentType()) {
if (false !== strpos($this->contentType(), 'application/json')) {
$this->put = (array) json_decode($content, true);
} else {
parse_str($content, $this->put);
@@ -1357,7 +1357,11 @@ class Request
{
$contentType = $this->server('CONTENT_TYPE');
if ($contentType) {
list($type) = explode(';', $contentType);
if (strpos($contentType, ';')) {
list($type) = explode(';', $contentType);
} else {
$type = $contentType;
}
return trim($type);
}
return '';