升级thinkphp到5.1.39

This commit is contained in:
cxdbz committed 2019-11-28 19:33:13 +08:00
1 parent c8839fa4f8
commit a58d04e7e2
37 files changed
+546 -192

No files matched your search

+16 -1
View File
@@ -682,6 +682,7 @@ class Request
// 判断URL里面是否有兼容模式参数
$pathinfo = $_GET[$this->config['var_pathinfo']];
unset($_GET[$this->config['var_pathinfo']]);
unset($this->get[$this->config['var_pathinfo']]);
} elseif ($this->isCli()) {
// CLI模式下 index.php module/controller/action/params/...
$pathinfo = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '';
@@ -702,6 +703,10 @@ class Request
}
}
if (!empty($pathinfo)) {
unset($this->get[$pathinfo], $this->request[$pathinfo]);
}
$this->pathinfo = empty($pathinfo) || '/' == $pathinfo ? '' : ltrim($pathinfo, '/');
}
@@ -1039,7 +1044,7 @@ class Request
protected function getInputData($content)
{
if (false !== strpos($this->contentType(), 'application/json') || 0 === strpos($content, '{"')) {
if (false !== strpos($this->contentType(), 'json')) {
return (array) json_decode($content, true);
} elseif (strpos($content, '=')) {
parse_str($content, $data);
@@ -1631,6 +1636,16 @@ class Request
return false;
}
/**
* 当前是否JSON请求
* @access public
* @return bool
*/
public function isJson()
{
return false !== strpos($this->type(), 'json');
}
/**
* 当前是否Ajax请求
* @access public