From 79ce9ec9842458b8383e50c7ee81e41ec6e42d07 Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 11 Jul 2023 10:33:39 +0900 Subject: [PATCH] =?UTF-8?q?6=EC=9B=94=2025=EC=9D=BC=20=EC=A0=9C=EB=B3=B4?= =?UTF-8?q?=ED=95=9C=20=EC=98=81=EC=B9=B4=ED=8A=B8=20=EB=B3=B4=EC=95=88?= =?UTF-8?q?=EC=B7=A8=EC=95=BD=EC=A0=90=20=EC=88=98=EC=A0=95=20#249?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/itemqaformupdate.php | 14 +++++++++----- shop/itemuseformupdate.php | 8 +++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/shop/itemqaformupdate.php b/shop/itemqaformupdate.php index bb44f1e19..36110b352 100644 --- a/shop/itemqaformupdate.php +++ b/shop/itemqaformupdate.php @@ -84,7 +84,7 @@ else if ($w == "d") alert("답변이 있는 상품문의는 삭제하실 수 없습니다."); } - // 에디터로 첨부된 이미지 삭제 + // 에디터로 첨부된 썸네일 이미지만 삭제 $sql = " select iq_question, iq_answer from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' and md5(concat(iq_id,iq_time,iq_ip)) = '{$hash}' "; $row = sql_fetch($sql); @@ -101,8 +101,10 @@ else if ($w == "d") $destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : ''; - if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) - @unlink($destfile); + if ($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) { + delete_item_thumbnail(dirname($destfile), basename($destfile)); + //@unlink($destfile); + } } } @@ -121,8 +123,10 @@ else if ($w == "d") $destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : ''; - if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) - @unlink($destfile); + if ($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) { + delete_item_thumbnail(dirname($destfile), basename($destfile)); + // @unlink($destfile); + } } } diff --git a/shop/itemuseformupdate.php b/shop/itemuseformupdate.php index 997e1bbab..6010631f2 100644 --- a/shop/itemuseformupdate.php +++ b/shop/itemuseformupdate.php @@ -93,7 +93,7 @@ else if ($w == "d") alert("자신의 사용후기만 삭제하실 수 있습니다."); } - // 에디터로 첨부된 이미지 삭제 + // 에디터로 첨부된 썸네일 이미지 삭제 $sql = " select is_content from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' and md5(concat(is_id,is_time,is_ip)) = '{$hash}' "; $row = sql_fetch($sql); @@ -111,8 +111,10 @@ else if ($w == "d") $destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : ''; - if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) - @unlink($destfile); + if ($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) { + delete_item_thumbnail(dirname($destfile), basename($destfile)); + //@unlink($destfile); + } } }