From 932a5155633fc669a4d6f2c41e0229272e11c3bc Mon Sep 17 00:00:00 2001 From: Comsenz <10433182@qq.com> Date: Mon, 7 Aug 2017 12:34:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/uc_server/model/base.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/upload/uc_server/model/base.php b/upload/uc_server/model/base.php index 3377be5..6e7d4fa 100644 --- a/upload/uc_server/model/base.php +++ b/upload/uc_server/model/base.php @@ -357,9 +357,17 @@ class base { } function input($k) { - if($k == 'uid' && !preg_match("/^[0-9]+$/", $this->input[$k])){ - return NULL; - } + if($k == 'uid') { + if(is_array($this->input[$k])) { + foreach ($this->input[$k] as $value) { + if(!preg_match("/^[0-9]+$/", $value)) { + return NULL; + } + } + } elseif(!preg_match("/^[0-9]+$/", $this->input[$k])) { + return NULL; + } + } return isset($this->input[$k]) ? (is_array($this->input[$k]) ? $this->input[$k] : trim($this->input[$k])) : NULL; }