diff --git a/upload/source/include/spacecp/spacecp_profile.php b/upload/source/include/spacecp/spacecp_profile.php index ef99a686c3cdb2fdc4c0cfd71d26be0348dd0790..f6b0043f2e863898b86cf88530bf5daeed49c27a 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");