From f296bb6d48c254f734a2fdd1181a2c8edc185474 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 15 Jun 2016 23:41:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BInput=E7=B1=BB=E7=9A=84file?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Input.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/Input.php b/library/think/Input.php index 5a5a9291..c71ec0de 100644 --- a/library/think/Input.php +++ b/library/think/Input.php @@ -238,12 +238,12 @@ class Input // 获取全部文件 $item = []; foreach ($array as $key => $val) { - if (empty($val['tmp_name'])) { - continue; - } if($val instanceof File){ $item[$key] = $val; }else{ + if (empty($val['tmp_name'])) { + continue; + } $item[$key] = new File($val['tmp_name'], $val); } } @@ -251,7 +251,7 @@ class Input } elseif (isset($array[$name])) { if($array[$name] instanceof File){ return $array[$name]; - }else{ + } elseif (!empty($array[$name]['tmp_name'])){ return new File($array[$name]['tmp_name'], $array[$name]); } }