delete_editor_thumbnail 에디터 썸네일이 삭제 안되는 오류 수정

This commit is contained in:
thisgun
2020-11-09 19:05:23 +09:00
parent 1cdb1b9397
commit 90ff96c581

View File

@ -2330,7 +2330,7 @@ function delete_editor_thumbnail($contents)
run_event('delete_editor_thumbnail_before', $contents); run_event('delete_editor_thumbnail_before', $contents);
// $contents 중 img 태그 추출 // $contents 중 img 태그 추출
$matchs = get_editor_image($contents); $matchs = get_editor_image($contents, false);
if(!$matchs) if(!$matchs)
return; return;
@ -2338,8 +2338,8 @@ function delete_editor_thumbnail($contents)
for($i=0; $i<count($matchs[1]); $i++) { for($i=0; $i<count($matchs[1]); $i++) {
// 이미지 path 구함 // 이미지 path 구함
$imgurl = @parse_url($matchs[1][$i]); $imgurl = @parse_url($matchs[1][$i]);
$srcfile = $_SERVER['DOCUMENT_ROOT'].$imgurl['path']; $srcfile = dirname(G5_PATH).$imgurl['path'];
if(! preg_match('/(\.jpe?g|\.gif|\.png)$/i', $srcfile)) continue;
$filename = preg_replace("/\.[^\.]+$/i", "", basename($srcfile)); $filename = preg_replace("/\.[^\.]+$/i", "", basename($srcfile));
$filepath = dirname($srcfile); $filepath = dirname($srcfile);
$files = glob($filepath.'/thumb-'.$filename.'*'); $files = glob($filepath.'/thumb-'.$filename.'*');