2023.03.16
23
ytj
打开:thinkphp\library\think\Request.php文件,搜索 method 方法,原来的函数方法是这样的如下:
public function method($method = false)
{
if (true === $method) {
// 获取原始请求类型
return $this->server('REQUEST_METHOD') ?: 'GET';
} elseif (!$this->method) {
if (isset($_POST[Config::get('var_method')])) {
$this->method = strtoupper($_POST[Config::get('var_method')]);
$this->{$this->method}($_POST);
} elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
$this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
} else {
$this->method = $this->server('REQUEST_METHOD') ?: 'GET';
}
}
return $this->method;
}
改成下面:
public function method($method = false) { if (true === $method) { // 获取原始请求类型 return $this->server('REQUEST_METHOD') ?: 'GET'; } elseif (!$this->method) { if (isset($_POST[Config::get('var_method')])) { $method = strtoupper($_POST[Config::get('var_method')]); if (in_array($method, ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'])) { $this->method = $method; $this->{$this->method}($_POST); } else { $this->method = 'POST'; } unset($_POST[Config::get('var_method')]); } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { $this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); } else { $this->method = $this->server('REQUEST_METHOD') ?: 'GET'; } } return $this->method; }
然后,打开:thinkphp\library\think\App.php文件,搜索 model方法,原来的函数方法是这样的如下:
就OK啦!// 获取控制器名 374 $controller = strip_tags($result[1] ?: $config['default_controller']); 375 $controller = $convert ? strtolower($controller) : $controller;加上://修复漏洞 if ($controller && !preg_match('/^[A-Za-z][\w|\.]*$/', $controller)) { throw new HttpException(404, 'controller not exists:' . $controller); }
2023.03.07
23
今天和大家聊聊我对「SaaS」和「SaaS 用户体验」价值思考及设计实践总结分享,本文从如下三个方面展开: 如何理解 SaaS 和传统软件的差别 重新认识 B 端用户体验的价值 SaaS 用户体验设计体系实践思考。