From 699f268232fdcadc9b71be3d3e8215d21d502b6c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 12 Aug 2016 17:36:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB=20=E5=9C=A8?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=20get=20post=20put=20route=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=20=E6=B8=85=E7=A9=BAparam=E5=8F=98?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=8F=96=E6=B6=88=20param?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E8=B5=8B=E5=80=BC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index d565eeb0..76b29fa5 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -599,11 +599,6 @@ class Request */ public function param($name = '', $default = null, $filter = null) { - if (is_array($name)) { - // 设置param - $this->param = array_merge($this->param, $name); - return; - } if (empty($this->param)) { $method = $this->method(true); // 自动获取请求变量 @@ -642,6 +637,7 @@ class Request public function route($name = '', $default = null, $filter = null) { if (is_array($name)) { + $this->param = []; return $this->route = array_merge($this->route, $name); } return $this->input($this->route, $name, $default, $filter); @@ -658,6 +654,7 @@ class Request public function get($name = '', $default = null, $filter = null) { if (is_array($name)) { + $this->param = []; return $this->get = array_merge($this->get, $name); } elseif (empty($this->get)) { $this->get = $_GET; @@ -676,6 +673,7 @@ class Request public function post($name = '', $default = null, $filter = null) { if (is_array($name)) { + $this->param = []; return $this->post = array_merge($this->post, $name); } elseif (empty($this->post)) { $this->post = $_POST; @@ -694,6 +692,7 @@ class Request public function put($name = '', $default = null, $filter = null) { if (is_array($name)) { + $this->param = []; return $this->put = is_null($this->put) ? $name : array_merge($this->put, $name); } if (is_null($this->put)) { @@ -743,6 +742,7 @@ class Request public function request($name = '', $default = null, $filter = null) { if (is_array($name)) { + $this->param = []; return $this->request = array_merge($this->request, $name); } elseif (empty($this->request)) { $this->request = $_REQUEST;