From b27dc23b7072e825e4286ae9cd51de0af1cd19b1 Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 21 Feb 2013 18:11:47 +0900 Subject: [PATCH] =?UTF-8?q?get=5Feditor=5Fimage()=20=EC=99=80=20delete=5Fe?= =?UTF-8?q?ditor=5Fthumbnail()=20=ED=95=A8=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/common.lib.php b/lib/common.lib.php index be5cb2a69..5704abb15 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1720,4 +1720,34 @@ function delete_cache_latest($bo_table) unlink($filename); } } + +// 에디터 이미지 얻기 +function get_editor_image($contents) +{ + // $contents 중 img 태그 추출 + $pattern = "/]*src=[\'\"]?([^>\'\"]+".str_replace(".", "\.", $_SERVER['HTTP_HOST'])."[^>\'\"]+)[\'\"]?[^>]*>/"; + preg_match_all($pattern, $contents, $matchs); + + return $matchs; +} + +// 에디터 썸네일 삭제 +function delete_editor_thumbnail($contents) +{ + // $contents 중 img 태그 추출 + $matchs = get_editor_image($contents); + + for($i=0; $i \ No newline at end of file