From 63cacc6e29dafbc306619b6bb2176954fe6eb52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=96=E4=B8=AD=E6=B2=89?= <341936031@qq.com> Date: Tue, 4 Apr 2023 08:04:15 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AE=BE=E7=BD=AE=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 湖中沉 <341936031@qq.com> --- upload/source/include/spacecp/spacecp_profile.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/upload/source/include/spacecp/spacecp_profile.php b/upload/source/include/spacecp/spacecp_profile.php index ef99a686c..f6b0043f2 100644 --- a/upload/source/include/spacecp/spacecp_profile.php +++ b/upload/source/include/spacecp/spacecp_profile.php @@ -197,15 +197,19 @@ if(submitcheck('profilesubmit')) { foreach($_GET['deletefile'] as $key => $value) { if(isset($_G['cache']['profilesetting'][$key]) && $_G['cache']['profilesetting'][$key]['formtype'] == 'file') { $verifyarr[$key] = $setarr[$key] = ''; + @unlink(getglobal('setting/attachdir').'./profile/'.$space[$key]); } } } - if($_FILES && $field['formtype'] == 'file') { + if($_FILES) { $upload = new discuz_upload(); foreach($_FILES as $key => $file) { if(!isset($_G['cache']['profilesetting'][$key])) { continue; } + if($_G['cache']['profilesetting'][$key]['formtype'] != 'file'){ + continue; + } $field = $_G['cache']['profilesetting'][$key]; if((!empty($file) && $file['error'] == 0) || (!empty($space[$key]) && empty($_GET['deletefile'][$key]))) { $value = '1'; @@ -241,6 +245,7 @@ if(submitcheck('profilesubmit')) { $verifyarr[$key] = $attach['attachment']; continue; } + @unlink(getglobal('setting/attachdir').'./profile/'.$space[$key]); $setarr[$key] = $attach['attachment']; } @@ -641,7 +646,6 @@ if($operation == 'password') { } } } - } include template("home/spacecp_profile"); -- Gitee