内核更新
This commit is contained in:
@@ -11,11 +11,6 @@
|
||||
|
||||
namespace think;
|
||||
|
||||
use think\Config;
|
||||
use think\Exception;
|
||||
use think\File;
|
||||
use think\Session;
|
||||
|
||||
class Request
|
||||
{
|
||||
/**
|
||||
@@ -25,7 +20,7 @@ class Request
|
||||
|
||||
protected $method;
|
||||
/**
|
||||
* @var string 域名
|
||||
* @var string 域名(含协议和端口)
|
||||
*/
|
||||
protected $domain;
|
||||
|
||||
@@ -226,8 +221,9 @@ class Request
|
||||
if (!isset($info['path'])) {
|
||||
$info['path'] = '/';
|
||||
}
|
||||
$options = [];
|
||||
$queryString = '';
|
||||
$options = [];
|
||||
$options[strtolower($method)] = $params;
|
||||
$queryString = '';
|
||||
if (isset($info['query'])) {
|
||||
parse_str(html_entity_decode($info['query']), $query);
|
||||
if (!empty($params)) {
|
||||
@@ -240,6 +236,11 @@ class Request
|
||||
} elseif (!empty($params)) {
|
||||
$queryString = http_build_query($params, '', '&');
|
||||
}
|
||||
if ($queryString) {
|
||||
parse_str($queryString, $get);
|
||||
$options['get'] = isset($options['get']) ? array_merge($get, $options['get']) : $get;
|
||||
}
|
||||
|
||||
$server['REQUEST_URI'] = $info['path'] . ('' !== $queryString ? '?' . $queryString : '');
|
||||
$server['QUERY_STRING'] = $queryString;
|
||||
$options['cookie'] = $cookie;
|
||||
@@ -257,7 +258,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前包含协议的域名
|
||||
* 设置或获取当前包含协议的域名
|
||||
* @access public
|
||||
* @param string $domain 域名
|
||||
* @return string
|
||||
@@ -274,7 +275,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前完整URL 包括QUERY_STRING
|
||||
* 设置或获取当前完整URL 包括QUERY_STRING
|
||||
* @access public
|
||||
* @param string|true $url URL地址 true 带域名获取
|
||||
* @return string
|
||||
@@ -301,7 +302,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前URL 不含QUERY_STRING
|
||||
* 设置或获取当前URL 不含QUERY_STRING
|
||||
* @access public
|
||||
* @param string $url URL地址
|
||||
* @return string
|
||||
@@ -319,7 +320,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前执行的文件 SCRIPT_NAME
|
||||
* 设置或获取当前执行的文件 SCRIPT_NAME
|
||||
* @access public
|
||||
* @param string $file 当前执行的文件
|
||||
* @return string
|
||||
@@ -351,7 +352,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取URL访问根地址
|
||||
* 设置或获取URL访问根地址
|
||||
* @access public
|
||||
* @param string $url URL地址
|
||||
* @return string
|
||||
@@ -455,7 +456,7 @@ class Request
|
||||
*/
|
||||
public function type()
|
||||
{
|
||||
$accept = isset($this->server['HTTP_ACCEPT']) ? $this->server['HTTP_ACCEPT'] : $_SERVER['HTTP_ACCEPT'];
|
||||
$accept = $this->server('HTTP_ACCEPT');
|
||||
if (empty($accept)) {
|
||||
return false;
|
||||
}
|
||||
@@ -602,7 +603,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置获取获取当前请求的参数
|
||||
* 获取获取当前请求的参数
|
||||
* @access public
|
||||
* @param string|array $name 变量名
|
||||
* @param mixed $default 默认值
|
||||
@@ -688,7 +689,7 @@ class Request
|
||||
if (empty($this->post)) {
|
||||
$content = $this->input;
|
||||
if (empty($_POST) && strpos($content, '":')) {
|
||||
$this->post = json_decode($content, true);
|
||||
$this->post = (array) json_decode($content, true);
|
||||
} else {
|
||||
$this->post = $_POST;
|
||||
}
|
||||
@@ -713,7 +714,7 @@ class Request
|
||||
if (is_null($this->put)) {
|
||||
$content = $this->input;
|
||||
if (strpos($content, '":')) {
|
||||
$this->put = json_decode($content, true);
|
||||
$this->put = (array) json_decode($content, true);
|
||||
} else {
|
||||
parse_str($content, $this->put);
|
||||
}
|
||||
@@ -885,7 +886,7 @@ class Request
|
||||
return $array[$name];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user