mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Request类的create方法
This commit is contained in:
@@ -226,8 +226,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 +241,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;
|
||||
|
||||
Reference in New Issue
Block a user