From 63822016d5017e5264635df9a48434afb91a33e7 Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 17 Jun 2020 19:56:18 +0900 Subject: [PATCH 1/7] =?UTF-8?q?get=5Fmember=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index da968e569..51185f61e 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -773,7 +773,8 @@ function get_member($mb_id, $fields='*', $is_cache=false) { global $g5; - $mb_id = preg_replace("/[^0-9a-z_]+/i", "", $mb_id); + if (preg_match("/[^0-9a-z_]+/i", $mb_id)) + return array(); static $cache = array(); From 94a8cc3eb6a5b274b0cfdfdaefa0044252660f27 Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 26 Jun 2020 12:11:12 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20SMS=20?= =?UTF-8?q?=ED=9C=B4=EB=8C=80=ED=8F=B0=EB=B2=88=ED=98=B8=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/sms_admin/num_book.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adm/sms_admin/num_book.php b/adm/sms_admin/num_book.php index f4338c307..d6a658567 100644 --- a/adm/sms_admin/num_book.php +++ b/adm/sms_admin/num_book.php @@ -13,12 +13,12 @@ $g5['title'] = "휴대폰번호 관리"; if ($page < 1) $page = 1; -$bg_no = isset($bg_no) ? (int) $bg_no : 0; +$bg_no = isset($bg_no) ? preg_replace('/[^0-9]/i', '', $bg_no) : ''; $st = isset($st) ? preg_replace('/[^a-z0-9]/i', '', $st) : ''; $sql_korean = $sql_group = $sql_search = $sql_no_hp = ''; -if (is_numeric($bg_no)) +if (is_numeric($bg_no) && $bg_no) $sql_group = " and bg_no='$bg_no' "; else $sql_group = ""; From ccf8a2771354f56d82c7f7464aebb0ac8916daa0 Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 14 Jul 2020 17:09:36 +0900 Subject: [PATCH 3/7] =?UTF-8?q?SMS=20=EB=A6=AC=ED=84=B4=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/icode.sms.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/icode.sms.lib.php b/lib/icode.sms.lib.php index 6201f0081..a2a79a449 100644 --- a/lib/icode.sms.lib.php +++ b/lib/icode.sms.lib.php @@ -237,6 +237,7 @@ class SMS { fclose($fp); } $this->Data=array(); + return true; } } ?> \ No newline at end of file From dd7bd68e72b10d8d949296334de04204cf81e8b0 Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 14 Jul 2020 17:51:13 +0900 Subject: [PATCH 4/7] =?UTF-8?q?RSS=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=EB=A7=81=ED=81=AC=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/rss.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbs/rss.php b/bbs/rss.php index 6042fc6dd..9d6def1d0 100644 --- a/bbs/rss.php +++ b/bbs/rss.php @@ -70,7 +70,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) { <?php echo specialchars_replace($row['wr_subject']); ?> - + ]]> Date: Wed, 29 Jul 2020 17:11:28 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EB=B3=84?= =?UTF-8?q?=EB=A1=9C=20=EC=97=90=EB=94=94=ED=84=B0=EB=A5=BC=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=ED=95=A0=EC=88=98=20=EC=9E=88=EA=B2=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/board_form.php | 25 +++++++++++++++++++++++++ adm/board_form_update.php | 3 +++ common.php | 15 ++++++++++----- install/gnuboard5.sql | 1 + 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/adm/board_form.php b/adm/board_form.php index f75650a74..58b9538c3 100644 --- a/adm/board_form.php +++ b/adm/board_form.php @@ -80,6 +80,10 @@ if (!isset($board['bo_use_captcha'])) { sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_captcha` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_sns` "); } +if (!isset($board['bo_select_editor'])) { + sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_select_editor` VARCHAR(50) NOT NULL DEFAULT '' AFTER `bo_use_dhtml_editor` "); +} + $required = ""; $readonly = ""; $sound_only = ""; @@ -482,6 +486,27 @@ $pg_anchor = '
    + + + + + + + + + + + + + diff --git a/adm/board_form_update.php b/adm/board_form_update.php index bea127247..79a882870 100644 --- a/adm/board_form_update.php +++ b/adm/board_form_update.php @@ -114,6 +114,7 @@ $sql_common = " gr_id = '{$gr_id}', bo_use_file_content = '{$_POST['bo_use_file_content']}', bo_use_secret = '{$_POST['bo_use_secret']}', bo_use_dhtml_editor = '{$_POST['bo_use_dhtml_editor']}', + bo_select_editor = '{$_POST['bo_select_editor']}', bo_use_rss_view = '{$_POST['bo_use_rss_view']}', bo_use_good = '{$_POST['bo_use_good']}', bo_use_nogood = '{$_POST['bo_use_nogood']}', @@ -301,6 +302,7 @@ if (is_checked('chk_grp_use_sideview')) $grp_fields .= " , bo_use_sidevi if (is_checked('chk_grp_use_file_content')) $grp_fields .= " , bo_use_file_content = '{$bo_use_file_content}' "; if (is_checked('chk_grp_use_secret')) $grp_fields .= " , bo_use_secret = '{$bo_use_secret}' "; if (is_checked('chk_grp_use_dhtml_editor')) $grp_fields .= " , bo_use_dhtml_editor = '{$bo_use_dhtml_editor}' "; +if (is_checked('chk_grp_select_editor')) $grp_fields .= " , bo_select_editor = '{$bo_select_editor}' "; if (is_checked('chk_grp_use_rss_view')) $grp_fields .= " , bo_use_rss_view = '{$bo_use_rss_view}' "; if (is_checked('chk_grp_use_good')) $grp_fields .= " , bo_use_good = '{$bo_use_good}' "; if (is_checked('chk_grp_use_nogood')) $grp_fields .= " , bo_use_nogood = '{$bo_use_nogood}' "; @@ -390,6 +392,7 @@ if (is_checked('chk_all_use_sideview')) $all_fields .= " , bo_use_sidevi if (is_checked('chk_all_use_file_content')) $all_fields .= " , bo_use_file_content = '{$bo_use_file_content}' "; if (is_checked('chk_all_use_secret')) $all_fields .= " , bo_use_secret = '{$bo_use_secret}' "; if (is_checked('chk_all_use_dhtml_editor')) $all_fields .= " , bo_use_dhtml_editor = '{$bo_use_dhtml_editor}' "; +if (is_checked('chk_all_select_editor')) $all_fields .= " , bo_select_editor = '{$bo_select_editor}' "; if (is_checked('chk_all_use_rss_view')) $all_fields .= " , bo_use_rss_view = '{$bo_use_rss_view}' "; if (is_checked('chk_all_use_good')) $all_fields .= " , bo_use_good = '{$bo_use_good}' "; if (is_checked('chk_all_use_nogood')) $all_fields .= " , bo_use_nogood = '{$bo_use_nogood}' "; diff --git a/common.php b/common.php index e1a00b2ba..4423de19b 100644 --- a/common.php +++ b/common.php @@ -260,10 +260,6 @@ if( $config['cf_cert_use'] || (defined('G5_YOUNGCART_VER') && G5_YOUNGCART_VER) define('G5_HTTP_BBS_URL', https_url(G5_BBS_DIR, false)); define('G5_HTTPS_BBS_URL', https_url(G5_BBS_DIR, true)); -if ($config['cf_editor']) - define('G5_EDITOR_LIB', G5_EDITOR_PATH."/{$config['cf_editor']}/editor.lib.php"); -else - define('G5_EDITOR_LIB', G5_LIB_PATH."/editor.lib.php"); define('G5_CAPTCHA_DIR', !empty($config['cf_captcha']) ? $config['cf_captcha'] : 'kcaptcha'); define('G5_CAPTCHA_URL', G5_PLUGIN_URL.'/'.G5_CAPTCHA_DIR); @@ -461,12 +457,22 @@ if ($bo_table) { } } } + + // 게시판에서 + if (isset($board['bo_select_editor']) && $board['bo_select_editor']){ + $config['cf_editor'] = $board['bo_select_editor']; + } } if ($gr_id && !is_array($gr_id)) { $group = get_group($gr_id); } +if ($config['cf_editor']) { + define('G5_EDITOR_LIB', G5_EDITOR_PATH."/{$config['cf_editor']}/editor.lib.php"); +} else { + define('G5_EDITOR_LIB', G5_LIB_PATH."/editor.lib.php"); +} // 회원, 비회원 구분 $is_member = $is_guest = false; @@ -655,7 +661,6 @@ include_once(G5_BBS_PATH.'/visit_insert.inc.php'); // 일정 기간이 지난 DB 데이터 삭제 및 최적화 include_once(G5_BBS_PATH.'/db_table.optimize.php'); - // common.php 파일을 수정할 필요가 없도록 확장합니다. $extend_file = array(); $tmp = dir(G5_EXTEND_PATH); diff --git a/install/gnuboard5.sql b/install/gnuboard5.sql index 81c8645df..61b3e72af 100644 --- a/install/gnuboard5.sql +++ b/install/gnuboard5.sql @@ -47,6 +47,7 @@ CREATE TABLE IF NOT EXISTS `g5_board` ( `bo_use_file_content` tinyint(4) NOT NULL DEFAULT '0', `bo_use_secret` tinyint(4) NOT NULL DEFAULT '0', `bo_use_dhtml_editor` tinyint(4) NOT NULL DEFAULT '0', + `bo_select_editor` varchar(50) NOT NULL DEFAULT '', `bo_use_rss_view` tinyint(4) NOT NULL DEFAULT '0', `bo_use_good` tinyint(4) NOT NULL DEFAULT '0', `bo_use_nogood` tinyint(4) NOT NULL DEFAULT '0', From 12eabe493035b9a34b0a14fdfbf6f358dd70de51 Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 29 Jul 2020 17:31:27 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=ED=83=88=ED=87=B4=EB=90=9C=20=ED=9A=8C?= =?UTF-8?q?=EC=9B=90=EC=97=90=EA=B2=8C=20=EC=AA=BD=EC=A7=80=EB=A5=BC=20?= =?UTF-8?q?=EB=B3=B4=EB=82=BC=EC=88=98=20=EC=9E=88=EB=8A=94=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/memo_form_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbs/memo_form_update.php b/bbs/memo_form_update.php index c0244eee0..f95526e76 100644 --- a/bbs/memo_form_update.php +++ b/bbs/memo_form_update.php @@ -20,7 +20,7 @@ run_event('memo_form_update_before', $recv_list); for ($i=0; $i Date: Tue, 11 Aug 2020 17:59:14 +0900 Subject: [PATCH 7/7] =?UTF-8?q?=EC=8D=B8=EB=84=A4=EC=9D=BC=EA=B3=BC=20html?= =?UTF-8?q?purifier=20=ED=95=84=ED=84=B0=EB=A7=81=EC=97=90=20=EB=8C=80?= =?UTF-8?q?=ED=95=9C=20hook=20=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/board_form.php | 2 ++ bbs/move_update.php | 12 ++++++++++-- lib/common.lib.php | 6 +++++- lib/thumbnail.lib.php | 37 ++++++++++++++++++++++++++++++------- 4 files changed, 47 insertions(+), 10 deletions(-) diff --git a/adm/board_form.php b/adm/board_form.php index 58b9538c3..0fd63b0f3 100644 --- a/adm/board_form.php +++ b/adm/board_form.php @@ -84,6 +84,8 @@ if (!isset($board['bo_select_editor'])) { sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_select_editor` VARCHAR(50) NOT NULL DEFAULT '' AFTER `bo_use_dhtml_editor` "); } +run_event('adm_board_form_before', $board, $w); + $required = ""; $readonly = ""; $sound_only = ""; diff --git a/bbs/move_update.php b/bbs/move_update.php index 044586264..0b5f85508 100644 --- a/bbs/move_update.php +++ b/bbs/move_update.php @@ -27,6 +27,8 @@ $sql = " select distinct wr_num from $write_table where wr_id in ({$wr_id_list}) $result = sql_query($sql); while ($row = sql_fetch_array($result)) { + $save[$cnt]['wr_contents'] = array(); + $wr_num = $row['wr_num']; for ($i=0; $iset('Filter.Custom', array(new HTMLPurifier_Filter_Iframevideo())); $purifier = new HTMLPurifier($config); - return $purifier->purify($html); + return run_replace('html_purifier_result', $purifier->purify($html), $purifier, $html); } @@ -2318,6 +2318,8 @@ function delete_editor_thumbnail($contents) { if(!$contents) return; + + run_event('delete_editor_thumbnail_before', $contents); // $contents 중 img 태그 추출 $matchs = get_editor_image($contents); @@ -2338,6 +2340,8 @@ function delete_editor_thumbnail($contents) unlink($filename); } } + + run_event('delete_editor_thumbnail_after', $contents, $matchs); } // 1:1문의 첨부파일 썸네일 삭제 diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index 47e296801..d534edef1 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -110,6 +110,8 @@ function get_view_thumbnail($contents, $thumb_width=0) for($i=0; $i\'\"]+[^>\'\"]+)/i", $img, $m); $src = $m[1]; preg_match("/style=[\"\']?([^\"\'>]+)/i", $img, $m); @@ -161,16 +163,22 @@ function get_view_thumbnail($contents, $thumb_width=0) } } - // 원본 width가 thumb_width보다 작다면 - if($size[0] <= $thumb_width) - continue; - // Animated GIF 체크 $is_animated = false; if($size[2] == 1) { $is_animated = is_animated_gif($srcfile); + + if($replace_content = run_replace('thumbnail_is_animated_gif_content', '', $contents, $srcfile, $is_animated, $img_tag, $data_path, $size)){ + + $contents = $replace_content; + continue; + } } + // 원본 width가 thumb_width보다 작다면 + if($size[0] <= $thumb_width) + continue; + // 썸네일 높이 $thumb_height = round(($thumb_width * $size[1]) / $size[0]); $filename = basename($srcfile); @@ -192,7 +200,6 @@ function get_view_thumbnail($contents, $thumb_width=0) } // $img_tag에 editor 경로가 있으면 원본보기 링크 추가 - $img_tag = $matches[0][$i]; 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.''; @@ -687,8 +694,19 @@ and the roundoff errors in the Gaussian blur process, are welcome. } function is_animated_gif($filename) { - if(!($fh = @fopen($filename, 'rb'))) + + static $cache = array(); + $key = md5($filename); + + if( isset($cache[$key]) ){ + return $cache[$key]; + } + + if(!($fh = @fopen($filename, 'rb'))){ + $cache[$key] = false; return false; + } + $count = 0; // 출처 : http://www.php.net/manual/en/function.imagecreatefromgif.php#104473 // an animated gif contains multiple "frames", with each frame having a @@ -705,6 +723,11 @@ function is_animated_gif($filename) { } fclose($fh); - return $count > 1; + + $cache[$key] = ($count > 1) ? true : false; + + run_event('is_animated_gif_after', $filename, $cache[$key]); + + return $cache[$key]; } ?> \ No newline at end of file