Checked PSR-1: Basic Coding Standard & Undefined Variable
This commit is contained in:
@ -5,9 +5,9 @@ include_once('./_common.php');
|
||||
check_demo();
|
||||
|
||||
$post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
|
||||
$chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
|
||||
$act_button = isset($_POST['act_button']) ? strip_tags($_POST['act_button']) : '';
|
||||
$board_table = (isset($_POST['board_table']) && is_array($_POST['board_table'])) ? $_POST['board_table'] : array();
|
||||
$chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
|
||||
$act_button = isset($_POST['act_button']) ? strip_tags($_POST['act_button']) : '';
|
||||
$board_table = (isset($_POST['board_table']) && is_array($_POST['board_table'])) ? $_POST['board_table'] : array();
|
||||
|
||||
if (! $post_count_chk) {
|
||||
alert($act_button." 하실 항목을 하나 이상 체크하세요.");
|
||||
@ -16,11 +16,9 @@ if (! $post_count_chk) {
|
||||
check_admin_token();
|
||||
|
||||
if ($act_button === "선택수정") {
|
||||
|
||||
auth_check_menu($auth, $sub_menu, 'w');
|
||||
|
||||
for ($i=0; $i<$post_count_chk; $i++) {
|
||||
|
||||
// 실제 번호를 넘김
|
||||
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
|
||||
|
||||
@ -43,8 +41,9 @@ if ($act_button === "선택수정") {
|
||||
and a.gr_id = b.gr_id
|
||||
and b.gr_admin = '{$member['mb_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['cnt'])
|
||||
if (!$row['cnt']) {
|
||||
alert('최고관리자가 아닌 경우 다른 관리자의 게시판('.$board_table[$k].')은 수정이 불가합니다.');
|
||||
}
|
||||
}
|
||||
|
||||
$p_bo_subject = is_array($_POST['bo_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_subject'][$k])) : '';
|
||||
@ -66,15 +65,17 @@ if ($act_button === "선택수정") {
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
} else if ($act_button === "선택삭제") {
|
||||
|
||||
if ($is_admin != 'super')
|
||||
} elseif ($act_button === "선택삭제") {
|
||||
if ($is_admin != 'super') {
|
||||
alert('게시판 삭제는 최고관리자만 가능합니다.');
|
||||
}
|
||||
|
||||
auth_check_menu($auth, $sub_menu, 'd');
|
||||
|
||||
// _BOARD_DELETE_ 상수를 선언해야 board_delete.inc.php 가 정상 작동함
|
||||
/* 확인필요 22.05.27
|
||||
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects,
|
||||
or it should execute logic with side effects, but should not do both.*/
|
||||
define('_BOARD_DELETE_', true);
|
||||
|
||||
for ($i=0; $i<$post_count_chk; $i++) {
|
||||
@ -84,14 +85,12 @@ if ($act_button === "선택수정") {
|
||||
// include 전에 $bo_table 값을 반드시 넘겨야 함
|
||||
$tmp_bo_table = isset($_POST['board_table'][$k]) ? trim(clean_xss_tags($_POST['board_table'][$k], 1, 1)) : '';
|
||||
|
||||
if( preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table) ){
|
||||
include ('./board_delete.inc.php');
|
||||
if (preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table)) {
|
||||
include('./board_delete.inc.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
run_event('admin_board_list_update', $act_button, $chk, $board_table, $qstr);
|
||||
|
||||
goto_url('./board_list.php?'.$qstr);
|
||||
goto_url('./board_list.php?'.$qstr);
|
||||
|
||||
Reference in New Issue
Block a user