From df8cd50a12722297e1f7ae6370af9f805910ceb2 Mon Sep 17 00:00:00 2001 From: Comsenz <10433182@qq.com> Date: Fri, 28 Jul 2017 09:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E4=B8=A5=E8=B0=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/function/function_upload.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/upload/source/function/function_upload.php b/upload/source/function/function_upload.php index 5a5c584..c871875 100644 --- a/upload/source/function/function_upload.php +++ b/upload/source/function/function_upload.php @@ -37,11 +37,13 @@ function getuploadconfig($uid=0, $fid=0, $limit=true) { loadcache('attachtype'); $fid = isset($_G['cache']['attachtype'][$fid]) ? $fid : 0; $filter = array(); - foreach($_G['cache']['attachtype'][$fid] as $extension => $maxsize) { - if($maxsize == 0) { - $notallow[] = $extension; - } else { - $filter[] = "'$extension':$maxsize"; + if(is_array($_G['cache']['attachtype'][$fid])) { + foreach($_G['cache']['attachtype'][$fid] as $extension => $maxsize) { + if($maxsize == 0) { + $notallow[] = $extension; + } else { + $filter[] = "'$extension':$maxsize"; + } } } if(!empty($filter)) {