전콘 변경시 이전 파일명을 제대로 추적하도록 변경
This commit is contained in:
@@ -18,9 +18,9 @@ $member = $DB->Get($rs);
|
||||
|
||||
$picName = $member['PICTURE'];
|
||||
|
||||
if($picName && strlen($picName) > 10){
|
||||
if($picName && strlen($picName) > 11){
|
||||
$dt = substr($picName, -8);
|
||||
$picName = substr($picName, 0, -9);
|
||||
$picName = substr($picName, 0, -10);
|
||||
}
|
||||
else{
|
||||
$dt = '00000000';
|
||||
@@ -39,8 +39,8 @@ if($dt == $rf) {
|
||||
$response['result'] = 'FAIL';
|
||||
} else {
|
||||
$DB->Update('MEMBER', "PICTURE='', IMGSVR=0", "NO='{$SESSION->NoMember()}'");
|
||||
if(file_exists(__DIR__.'/'.$dest)){
|
||||
@unlink(__DIR__.'/'.$dest);
|
||||
if(file_exists($dest)){
|
||||
@unlink($dest);
|
||||
}
|
||||
|
||||
for($i=0; $i < $_serverCount; $i++) {
|
||||
|
||||
@@ -27,9 +27,9 @@ $member = $DB->Get($rs);
|
||||
$picName = $member['PICTURE'];
|
||||
$newExt = array_search($imageType, $availableImageType, true);
|
||||
|
||||
if($picName && strlen($picName) > 10){
|
||||
if($picName && strlen($picName) > 11){
|
||||
$dt = substr($picName, -8);
|
||||
$picName = substr($picName, 0, -9);
|
||||
$picName = substr($picName, 0, -10);
|
||||
}
|
||||
else{
|
||||
$dt = '00000000';
|
||||
@@ -78,8 +78,8 @@ if(!is_uploaded_file($image['tmp_name'])) {
|
||||
$response['msg'] = '업로드에 실패했습니다!';
|
||||
$response['result'] = 'FAIL';
|
||||
} else {
|
||||
if(file_exists(__DIR__.'/'.$old_path)){
|
||||
@unlink(__DIR__.'/'.$old_path);
|
||||
if(file_exists($old_path)){
|
||||
@unlink($old_path);
|
||||
}
|
||||
$pic = "{$newPicName}?={$rf}";
|
||||
$DB->Update('MEMBER', "PICTURE='{$pic}', IMGSVR=1", "NO='{$SESSION->NoMember()}'");
|
||||
|
||||
Reference in New Issue
Block a user