diff --git a/lib/common.lib.php b/lib/common.lib.php
index 0233a5b4b..62146cad1 100644
--- a/lib/common.lib.php
+++ b/lib/common.lib.php
@@ -2006,7 +2006,8 @@ function get_editor_image($contents)
return false;
// $contents 중 img 태그 추출
- $pattern = "/
]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
+ //$pattern = "/
]*src=[\'\"]?([^>\'\"]+[^>\'\"]+)[\'\"]?[^>]*>/";
+ $pattern = "/
]*)>/iS";
preg_match_all($pattern, $contents, $matchs);
return $matchs;
diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php
index ceb3e4579..31f4b7e7f 100644
--- a/lib/thumbnail.lib.php
+++ b/lib/thumbnail.lib.php
@@ -22,13 +22,13 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$write_table = $g5['write_prefix'].$bo_table;
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
$write = sql_fetch($sql);
- $matchs = get_editor_image($write['wr_content']);
+ $matches = get_editor_image($write['wr_content']);
$edt = true;
- for($i=0; $i\'\"]+[^>\'\"]+)/i", $img, $m);
+ $src = $m[1];
+ preg_match("/style=[\"\']?([^\"\'>]+)/i", $img, $m);
+ $style = $m[1];
+ preg_match("/width:\s*(\d+)px/", $style, $m);
+ $width = $m[1];
+ preg_match("/height:\s*(\d+)px/", $style, $m);
+ $height = $m[1];
+
// 이미지 path 구함
- $p = parse_url($matchs[1][$i]);
+ $p = parse_url($src);
if(strpos($p['path'], "/data/") != 0)
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
else
@@ -154,14 +165,18 @@ function get_view_thumbnail($contents, $thumb_width=0)
else
$thumb_file = $filename;
- $img_tag = $matchs[0][$i];
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $img_tag, $malt);
$alt = get_text($malt[1]);
- $thumb_tag = '
';
+ if ($width) {
+ $thumb_tag = '
';
+ } else {
+ $thumb_tag = '
';
+ }
// $img_tag에 editor 경로가 있으면 원본보기 링크 추가
- if(strpos($matchs[1][$i], 'data/editor') && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) {
- $imgurl = str_replace(G5_URL, "", $matchs[1][$i]);
+ $img_tag = $matches[0][$i];
+ if(strpos($img_tag, 'data/editor') && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) {
+ $imgurl = str_replace(G5_URL, "", $img_tag);
$thumb_tag = ''.$thumb_tag.'';
}