From 616f5b8d4657f9002526dbac3a6b7ff10ac0951d Mon Sep 17 00:00:00 2001 From: maycactus <138797510+maycactus-FOSS@users.noreply.github.com> Date: Wed, 16 Aug 2023 15:37:08 -0400 Subject: [PATCH 1/4] =?UTF-8?q?Refactor:=20str=5Fencrypt=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=EC=9D=98=20=EB=B3=80=EC=88=98=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index a0f4960f1..3e689d589 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3804,7 +3804,7 @@ function check_vaild_callback($callback){ class str_encrypt { var $salt; - var $lenght; + var $length; function __construct($salt='') { From 941f3e135ab4de6aa5e39d5d54834e4dc21da834 Mon Sep 17 00:00:00 2001 From: Kkigomi <112419763+kkigomi@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:24:30 +0900 Subject: [PATCH 2/4] =?UTF-8?q?`$wr=5Fid`=20=EC=A0=84=EC=97=AD=EB=B3=80?= =?UTF-8?q?=EC=88=98=EC=9D=98=20=EA=B0=92=EC=9D=B4=20=EC=9E=98=EB=AA=BB?= =?UTF-8?q?=EB=90=9C=20=ED=83=80=EC=9E=85=EC=9C=BC=EB=A1=9C=20=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=EB=90=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EA=B3=A0?= =?UTF-8?q?=EC=B9=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 짧은 주소 '글 이름' 주소로 접근할 때 `$wr_id` 전역변수의 값이 `string` 타입으로 잘못 할당되는 문제를 `int` 타입으로 올바르게 바로 잡습니다 --- common.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common.php b/common.php index bb4da63b1..c541f5f2b 100644 --- a/common.php +++ b/common.php @@ -484,6 +484,7 @@ if (isset($_REQUEST['w'])) { $w = ''; } +/** @var int $wr_id 게시판 글의 ID */ if (isset($_REQUEST['wr_id'])) { $wr_id = (int)$_REQUEST['wr_id']; } else { @@ -581,27 +582,30 @@ if (isset($_SESSION['ss_mb_id']) && $_SESSION['ss_mb_id']) { // 로그인중이 } +/** @var array $write 글 데이터 */ $write = array(); +/** @var string $write_table 게시판 테이블 전체이름 */ $write_table = ''; if ($bo_table) { $board = get_board_db($bo_table, true); if (isset($board['bo_table']) && $board['bo_table']) { set_cookie("ck_bo_table", $board['bo_table'], 86400 * 1); $gr_id = $board['gr_id']; - $write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름 + // 게시판 테이블 전체이름 + $write_table = $g5['write_prefix'] . $bo_table; if (isset($wr_id) && $wr_id) { $write = get_write($write_table, $wr_id); } else if (isset($wr_seo_title) && $wr_seo_title) { $write = get_content_by_field($write_table, 'bbs', 'wr_seo_title', generate_seo_title($wr_seo_title)); - if( isset($write['wr_id']) ){ - $wr_id = $write['wr_id']; + if (isset($write['wr_id'])) { + $wr_id = (int) $write['wr_id']; } } } - - // 게시판에서 - if (isset($board['bo_select_editor']) && $board['bo_select_editor']){ + + // 게시판에서 사용하는 에디터를 설정 + if (isset($board['bo_select_editor']) && $board['bo_select_editor']) { $config['cf_editor'] = $board['bo_select_editor']; } } From cf2a8ab28284f816a9988a1fa631aa5343390435 Mon Sep 17 00:00:00 2001 From: Kkigomi <112419763+kkigomi@users.noreply.github.com> Date: Wed, 30 Aug 2023 01:06:07 +0900 Subject: [PATCH 3/4] =?UTF-8?q?`delete=5Fcache=5Flatest`=20Hook=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `delete_cache_latest()` 함수에 `delete_cache_latest` Hook 추가 --- lib/common.lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index a0f4960f1..fffc440d4 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -2464,14 +2464,19 @@ function check_device($device) } -// 게시판 최신글 캐시 파일 삭제 +/** + * 게시판 최신글 캐시 파일 삭제 + * @param string $bo_table 게시판 ID + */ function delete_cache_latest($bo_table) { if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) { return; } - g5_delete_cache_by_prefix('latest-'.$bo_table.'-'); + run_event('delete_cache_latest', $bo_table); + + g5_delete_cache_by_prefix('latest-' . $bo_table . '-'); } // 게시판 첨부파일 썸네일 삭제 From 8cd1df0f437de9fb41ac85cdb39e0b9d4b525286 Mon Sep 17 00:00:00 2001 From: kkigomi Date: Thu, 31 Aug 2023 21:17:40 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/board_copy_update.php | 1 - bbs/write_update.php | 1 - lib/Cache/obj.class.php | 1 - lib/common.lib.php | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/adm/board_copy_update.php b/adm/board_copy_update.php index 3a3a81675..ef80a0ebc 100644 --- a/adm/board_copy_update.php +++ b/adm/board_copy_update.php @@ -191,7 +191,6 @@ if ($copy_case == 'schema_data_both') { sql_query($sql, false); // 4.00.01 - // 위의 코드는 같은 테이블명을 사용하였다는 오류가 발생함. (희한하네 ㅡㅡ;) $sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' "; $result = sql_query($sql, false); for ($i = 0; $row = sql_fetch_array($result); $i++) { diff --git a/bbs/write_update.php b/bbs/write_update.php index 7eb821663..1ead118c3 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -258,7 +258,6 @@ if ($w == '' || $w == 'r') { $wr_reply = ''; } - // wr_num 서브쿼리 kkigomi 님 제안 $sql = " insert into $write_table set wr_num = " . ($w == 'r' ? "'$wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $write_table sq) ") . ", wr_reply = '$wr_reply', diff --git a/lib/Cache/obj.class.php b/lib/Cache/obj.class.php index 807be9f20..a974fbf03 100644 --- a/lib/Cache/obj.class.php +++ b/lib/Cache/obj.class.php @@ -72,7 +72,6 @@ Class G5_object_cache { * @param string $key * @param string $group * @return bool - * kkigomi 님이 고쳐주심 */ function delete($type, $key, $group = 'default') { diff --git a/lib/common.lib.php b/lib/common.lib.php index a0f4960f1..7a86feebc 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -4157,7 +4157,7 @@ function get_random_token_string($length=6) } $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; - $output = substr(str_shuffle($characters), 0, $length); // jihan001 님 제안코드로 수정 + $output = substr(str_shuffle($characters), 0, $length); return bin2hex($output); }