From a4600c8032bdb3382648b09ea2302ea95d89d35e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 18 Jul 2016 14:47:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4Request=E7=B1=BBparamWithFile?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E6=94=B9=E4=B8=BA=20param(true)=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B8=A6=E6=96=87=E4=BB=B6=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 44127ca5..798575d9 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -623,25 +623,15 @@ class Request // 当前请求参数和URL地址中的参数合并 $this->param = array_merge($this->route(false), $this->get(false), $vars); } + if (true === $name) { + // 获取包含文件上传信息的数组 + $file = $this->file(); + $data = array_merge($this->param, $file); + return $this->input($data, '', $default, $filter); + } return $this->input($this->param, $name, $default, $filter); } - /** - * 获取获取当前请求的参数 包含file - * @access public - * @param string|array $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function paramWithFile($name = '', $default = null, $filter = null) - { - $param = $this->param(false); - $file = $this->file(); - $data = array_merge($param, $file); - return $this->input($data, $name, $default, $filter); - } - /** * 设置获取获取路由参数 * @access public