From 0428e1b120e932365830acba0ef8cbc4616f70f7 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 7 Dec 2016 07:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=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/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 79c349f8..a30180a8 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -852,7 +852,7 @@ class Request $keys = array_keys($file); $count = count($file['name']); for ($i = 0; $i < $count; $i++) { - if (empty($file['tmp_name'][$i])) { + if (empty($file['tmp_name'][$i]) || !is_file($file['tmp_name'][$i])) { continue; } $temp['key'] = $key; @@ -866,7 +866,7 @@ class Request if ($file instanceof File) { $array[$key] = $file; } else { - if (empty($file['tmp_name'])) { + if (empty($file['tmp_name']) || !is_file($file['tmp_name'])) { continue; } $array[$key] = (new File($file['tmp_name']))->setUploadInfo($file);