From 83799ee4c8dfc475d550adf5559f07deab44404f Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 3 Jun 2014 13:06:40 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8D=B8=EB=84=A4=EC=9D=BC=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EA=B4=80=EB=A0=A8=20=EC=BD=94=EB=93=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/thumbnail.lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index f8db59dd8..a338770f9 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -161,6 +161,9 @@ function get_view_thumbnail($contents, $thumb_width=0) else $thumb_file = $filename; + if(!$thumb_file) + continue; + if ($width) { $thumb_tag = ''.$alt.''; } else { @@ -169,7 +172,7 @@ function get_view_thumbnail($contents, $thumb_width=0) // $img_tag에 editor 경로가 있으면 원본보기 링크 추가 $img_tag = $matches[0][$i]; - if(strpos($img_tag, 'data/editor') && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) { + if(strpos($img_tag, G5_DATA_DIR.'/'.G5_EDITOR_DIR) && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) { $imgurl = str_replace(G5_URL, "", $src); $thumb_tag = ''.$thumb_tag.''; } @@ -204,6 +207,10 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h @chmod($target_path, G5_DIR_PERMISSION); } + // 디렉토리가 존재하지 않거나 쓰기 권한이 없으면 썸네일 생성하지 않음 + if(!(is_dir($target_path) && is_writable($target_path))) + return ''; + // Animated GIF는 썸네일 생성하지 않음 if($size[2] == 1) { if(is_animated_gif($source_file))