From f50b4d419f6c3c7573931cd2d6574f066c49f6fc Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 20 Feb 2018 18:36:00 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EB=8C=93?= =?UTF-8?q?=EA=B8=80=20=EC=82=AD=EC=A0=9C=EC=8B=9C=20=ED=8F=AC=EC=9D=B8?= =?UTF-8?q?=ED=8A=B8=EB=82=B4=EC=97=AD=EC=9D=B4=20=EC=82=AC=EB=9D=BC?= =?UTF-8?q?=EC=A7=80=EC=A7=80=20=EC=95=8A=EB=8A=94=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 --- bbs/scrap_popin_update.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bbs/scrap_popin_update.php b/bbs/scrap_popin_update.php index 5c94f90b6..48513ea8b 100644 --- a/bbs/scrap_popin_update.php +++ b/bbs/scrap_popin_update.php @@ -45,6 +45,14 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level'])) // 원글이 존재한다면 if ($wr['wr_id']) { + + // 세션의 시간 검사 + // 4.00.15 - 댓글 수정시 연속 게시물 등록 메시지로 인한 오류 수정 + if ($w == 'c' && $_SESSION['ss_datetime'] >= (G5_SERVER_TIME - $config['cf_delay_sec']) && !$is_admin) + alert('너무 빠른 시간내에 게시물을 연속해서 올릴 수 없습니다.'); + + set_session('ss_datetime', G5_SERVER_TIME); + $mb_id = $member['mb_id']; $wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick'])); $wr_password = $member['mb_password']; @@ -86,7 +94,7 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level'])) sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' "); // 포인트 부여 - insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트'); + insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 댓글쓰기(스크랩)", $bo_table, $comment_id, '댓글'); } } From 9e8f75e8fa91498a75bb3cf95b0bf97922584a0e Mon Sep 17 00:00:00 2001 From: thisgun Date: Mon, 26 Feb 2018 09:04:15 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=ED=9A=8C=EC=9B=90=EC=9D=B4=20=EC=93=B4=20?= =?UTF-8?q?=EA=B3=B5=EC=A7=80=EA=B8=80=EC=9D=84=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=ED=95=A0=20=EA=B2=BD=EC=9A=B0=20=EA=B3=B5=EC=A7=80=EA=B0=80=20?= =?UTF-8?q?=ED=92=80=EB=A6=AC=EB=8A=94=20=EC=98=A4=EB=A5=98=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 --- bbs/write_update.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bbs/write_update.php b/bbs/write_update.php index 2b37dbd23..5b2b6f945 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -129,6 +129,16 @@ for ($i=1; $i<=10; $i++) { if ($w == '' || $w == 'u') { + // 외부에서 글을 등록할 수 있는 버그가 존재하므로 공지는 관리자만 등록이 가능해야 함 + if (!$is_admin && $notice) { + alert('관리자만 공지할 수 있습니다.'); + } + + //회원 자신이 쓴글을 수정할 경우 공지가 풀리는 경우가 있음 + if($w =='u' && $board['bo_notice'] && in_array($wr['wr_id'], $notice_array)){ + $notice = 1; + } + // 김선용 1.00 : 글쓰기 권한과 수정은 별도로 처리되어야 함 if($w =='u' && $member['mb_id'] && $wr['mb_id'] == $member['mb_id']) { ; @@ -136,11 +146,6 @@ if ($w == '' || $w == 'u') { alert('글을 쓸 권한이 없습니다.'); } - // 외부에서 글을 등록할 수 있는 버그가 존재하므로 공지는 관리자만 등록이 가능해야 함 - if (!$is_admin && $notice) { - alert('관리자만 공지할 수 있습니다.'); - } - } else if ($w == 'r') { if (in_array((int)$wr_id, $notice_array)) { From 5b9b29fdfeee72799948c0bca492d2ba9c361540 Mon Sep 17 00:00:00 2001 From: thisgun Date: Mon, 26 Feb 2018 11:50:17 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=EC=8B=9C=200=20=EB=AC=B8=EC=9E=90=EC=97=B4=EB=A1=9C?= =?UTF-8?q?=20=EA=B2=80=EC=83=89=ED=95=A0=EC=88=98=20=EC=9E=88=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/list.php | 14 +++++++++----- bbs/view.php | 2 +- common.php | 2 +- lib/common.lib.php | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/bbs/list.php b/bbs/list.php index 1bb0e4cd0..4752a316c 100644 --- a/bbs/list.php +++ b/bbs/list.php @@ -33,7 +33,11 @@ if ($sop != 'and' && $sop != 'or') // 분류 선택 또는 검색어가 있다면 $stx = trim($stx); -if ($sca || $stx) { +//검색인지 아닌지 구분하는 변수 초기화 +$is_search_bbs = false; + +if ($sca || $stx || $stx === '0') { //검색이면 + $is_search_bbs = true; //검색구분변수 true 지정 $sql_search = get_sql_search($sca, $sfl, $stx, $sop); // 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용) @@ -80,7 +84,7 @@ $notice_count = 0; $notice_array = array(); // 공지 처리 -if (!$sca && !$stx) { +if (!$is_search_bbs) { $arr_notice = explode(',', trim($board['bo_notice'])); $from_notice_idx = ($page - 1) * $page_rows; if($from_notice_idx < 0) @@ -162,7 +166,7 @@ if ($sst) { $sql_order = " order by {$sst} {$sod} "; } -if ($sca || $stx) { +if ($is_search_bbs) { $sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows "; } else { $sql = " select * from {$write_table} where wr_is_comment = 0 "; @@ -180,7 +184,7 @@ if($page_rows > 0) { while ($row = sql_fetch_array($result)) { // 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다 - if ($sca || $stx) + if ($is_search_bbs) $row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' "); $list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']); @@ -201,7 +205,7 @@ $write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['c $list_href = ''; $prev_part_href = ''; $next_part_href = ''; -if ($sca || $stx) { +if ($is_search_bbs) { $list_href = './board.php?bo_table='.$bo_table; $patterns = array('#&page=[0-9]*#', '#&spt=[0-9\-]*#'); diff --git a/bbs/view.php b/bbs/view.php index 1031da62c..1cfe55f67 100644 --- a/bbs/view.php +++ b/bbs/view.php @@ -10,7 +10,7 @@ if ($sop != 'and' && $sop != 'or') $sql_search = ""; // 검색이면 -if ($sca || $stx) { +if ($sca || $stx || $stx === '0') { // where 문을 얻음 $sql_search = get_sql_search($sca, $sfl, $stx, $sop); $search_href = './board.php?bo_table='.$bo_table.'&page='.$page.$qstr; diff --git a/common.php b/common.php index acf9a345a..68970c9c7 100644 --- a/common.php +++ b/common.php @@ -250,7 +250,7 @@ if (isset($_REQUEST['sfl'])) { if (isset($_REQUEST['stx'])) { // search text (검색어) $stx = get_search_string(trim($_REQUEST['stx'])); - if ($stx) + if ($stx || $stx === '0') $qstr .= '&stx=' . urlencode(cut_str($stx, 20, '')); } else { $stx = ''; diff --git a/lib/common.lib.php b/lib/common.lib.php index b194ffeeb..23f0db8ff 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -458,7 +458,7 @@ function search_font($stx, $str) $src = array('/', '|'); $dst = array('\/', '\|'); - if (!trim($stx)) return $str; + if (!trim($stx) && $stx !== '0') return $str; // 검색어 전체를 공란으로 나눈다 $s = explode(' ', $stx); @@ -597,7 +597,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op $search_text = strip_tags(($search_text)); $search_text = trim(stripslashes($search_text)); - if (!$search_text) { + if (!$search_text && $search_text !== '0') { if ($search_ca_name) { return $str; } else {