|
-
+
|
@@ -1242,7 +1242,7 @@ $pg_anchor = ' |
diff --git a/adm/board_form_update.php b/adm/board_form_update.php
index 2a8922c26..01a21fe97 100644
--- a/adm/board_form_update.php
+++ b/adm/board_form_update.php
@@ -9,7 +9,10 @@ auth_check($auth[$sub_menu], 'w');
check_admin_token();
-if (!$_POST['gr_id']) { alert('그룹 ID는 반드시 선택하세요.'); }
+$gr_id = isset($_POST['gr_id']) ? preg_replace('/[^a-z0-9_]/i', '', $_POST['gr_id']) : '';
+$bo_admin = isset($_POST['bo_admin']) ? preg_replace('/[^a-z0-9_\, \|\#]/i', '', $_POST['bo_admin']) : '';
+
+if (!$gr_id) { alert('그룹 ID는 반드시 선택하세요.'); }
if (!$bo_table) { alert('게시판 TABLE명은 반드시 입력하세요.'); }
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) { alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)'); }
if (!$_POST['bo_subject']) { alert('게시판 제목을 입력하세요.'); }
@@ -75,11 +78,11 @@ $str_bo_category_list = isset($_POST['bo_category_list']) ? preg_replace("/[\<\>
$_POST['bo_subject'] = strip_tags($_POST['bo_subject']);
$_POST['bo_mobile_subject'] = strip_tags($_POST['bo_mobile_subject']);
-$sql_common = " gr_id = '{$_POST['gr_id']}',
+$sql_common = " gr_id = '{$gr_id}',
bo_subject = '{$_POST['bo_subject']}',
bo_mobile_subject = '{$_POST['bo_mobile_subject']}',
bo_device = '{$_POST['bo_device']}',
- bo_admin = '{$_POST['bo_admin']}',
+ bo_admin = '{$bo_admin}',
bo_list_level = '{$_POST['bo_list_level']}',
bo_read_level = '{$_POST['bo_read_level']}',
bo_write_level = '{$_POST['bo_write_level']}',
@@ -443,7 +446,7 @@ delete_cache_latest($bo_table);
if(function_exists('get_admin_captcha_by'))
get_admin_captcha_by('remove');
-start_event('admin_board_form_update', $bo_table, $w);
+run_event('admin_board_form_update', $bo_table, $w);
goto_url("./board_form.php?w=u&bo_table={$bo_table}&{$qstr}");
?>
diff --git a/adm/boardgroup_list_update.php b/adm/boardgroup_list_update.php
index fbf9e2f1a..53d66c8e9 100644
--- a/adm/boardgroup_list_update.php
+++ b/adm/boardgroup_list_update.php
@@ -18,16 +18,16 @@ if(!$count)
for ($i=0; $i<$count; $i++)
{
$k = $_POST['chk'][$i];
- $gr_id = $_POST['group_id'][$k];
- $gr_subject = strip_tags($_POST['gr_subject'][$k]);
+ $gr_id = preg_replace('/[^a-z0-9_]/i', '', $_POST['group_id'][$k]);
+ $gr_subject = sql_real_escape_string(strip_tags($_POST['gr_subject'][$k]));
if($_POST['act_button'] == '선택수정') {
$sql = " update {$g5['group_table']}
set gr_subject = '{$gr_subject}',
- gr_device = '{$_POST['gr_device'][$k]}',
- gr_admin = '{$_POST['gr_admin'][$k]}',
- gr_use_access = '{$_POST['gr_use_access'][$k]}',
- gr_order = '{$_POST['gr_order'][$k]}'
+ gr_device = '".sql_real_escape_string($_POST['gr_device'][$k])."',
+ gr_admin = '".sql_real_escape_string($_POST['gr_admin'][$k])."',
+ gr_use_access = '".sql_real_escape_string($_POST['gr_use_access'][$k])."',
+ gr_order = '".sql_real_escape_string($_POST['gr_order'][$k])."'
where gr_id = '{$gr_id}' ";
if ($is_admin != 'super')
$sql .= " and gr_admin = '{$_POST['gr_admin'][$k]}' ";
diff --git a/adm/boardgroupmember_update.php b/adm/boardgroupmember_update.php
index 95f8372b3..56de9c4cc 100644
--- a/adm/boardgroupmember_update.php
+++ b/adm/boardgroupmember_update.php
@@ -48,7 +48,7 @@ else if ($w == 'd' || $w == 'ld')
check_admin_token();
for($i=0; $i<$count; $i++) {
- $gm_id = $_POST['chk'][$i];
+ $gm_id = (int) $_POST['chk'][$i];
$sql = " select * from {$g5['group_member_table']} where gm_id = '$gm_id' ";
$gm = sql_fetch($sql);
if (!$gm['gm_id']) {
diff --git a/adm/config_form.php b/adm/config_form.php
index 9a963faf7..a963723ef 100644
--- a/adm/config_form.php
+++ b/adm/config_form.php
@@ -259,12 +259,18 @@ if (!isset($config['cf_bbs_rewrite'])) {
ADD `cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_link_target` ", true);
}
-// 읽지 않은 메모 수 칼럼
+// 읽지 않은 메모 수 칼럼 추가
if(!isset($member['mb_memo_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}`
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`", true);
}
+// 스크랩 읽은 수 추가
+if(!isset($member['mb_scrap_cnt'])) {
+ sql_query(" ALTER TABLE `{$g5['member_table']}`
+ ADD `mb_scrap_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_cnt`", true);
+}
+
if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic";
if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic";
@@ -1435,6 +1441,10 @@ if($config['cf_cert_use']) {
}
echo module_exec_check($exe, 'okname');
+
+ if(is_dir(G5_OKNAME_PATH.'/log') && is_writable(G5_OKNAME_PATH.'/log') && function_exists('check_log_folder') ) {
+ check_log_folder(G5_OKNAME_PATH.'/log');
+ }
}
// kcp일 때
@@ -1452,16 +1462,29 @@ if($config['cf_cert_use']) {
$log_path = G5_LGXPAY_PATH.'/lgdacom/log';
if(!is_dir($log_path)) {
- echo ''.PHP_EOL;
- } else {
- if(!is_writable($log_path)) {
+
+ if( is_writable(G5_LGXPAY_PATH.'/lgdacom/') ){
+ // 디렉토리가 없다면 생성합니다. (퍼미션도 변경하구요.)
+ @mkdir($log_path, G5_DIR_PERMISSION);
+ @chmod($log_path, G5_DIR_PERMISSION);
+ }
+
+ if(!is_dir($log_path)){
echo ''.PHP_EOL;
}
}
+
+ if(is_dir($log_path) && is_writable($log_path)) {
+ if( function_exists('check_log_folder') ){
+ check_log_folder($log_path);
+ }
+ } else if (is_dir($log_path)) {
+ echo ''.PHP_EOL;
+ }
}
}
diff --git a/adm/config_form_update.php b/adm/config_form_update.php
index 56f196a9f..c8aff3bd9 100644
--- a/adm/config_form_update.php
+++ b/adm/config_form_update.php
@@ -28,6 +28,14 @@ $cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',',
$_POST['cf_title'] = strip_tags($_POST['cf_title']);
+$check_keys = array('cf_lg_mid', 'cf_lg_mert_key', 'cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key');
+
+foreach( $check_keys as $key ){
+ if ( isset($_POST[$key]) && $_POST[$key] ){
+ $_POST[$key] = preg_replace('/[^a-z0-9_\-]/i', '', $_POST[$key]);
+ }
+}
+
$sql = " update {$g5['config_table']}
set cf_title = '{$_POST['cf_title']}',
cf_admin = '{$_POST['cf_admin']}',
@@ -184,7 +192,7 @@ if( isset($_POST['cf_bbs_rewrite']) ){
g5_delete_all_cache();
}
-start_event('admin_config_form_update');
+run_event('admin_config_form_update');
update_rewrite_rules();
diff --git a/adm/css/admin.css b/adm/css/admin.css
index 86af09271..3ec245ead 100644
--- a/adm/css/admin.css
+++ b/adm/css/admin.css
@@ -404,6 +404,9 @@ tfoot th {}
#anc_bo_extra label {display:inline-block;width:100px}
#anc_bo_extra input {margin-right:10px}
+/* 게시판 여분필드 값 input style 로빈아빠님 제안 */
+#anc_bo_extra input.extra-value-input {width:calc(100% - 370px);}
+
/* 접속자집계 목록 */
.tbl_visit_list td {text-align:center}
.visit_bar {position:relative}
diff --git a/adm/dbupgrade.php b/adm/dbupgrade.php
index 52f94bd30..771d3214e 100644
--- a/adm/dbupgrade.php
+++ b/adm/dbupgrade.php
@@ -147,7 +147,7 @@ if(!isset($member['mb_memo_cnt'])) {
$is_check = true;
}
-$is_check = apply_replace('admin_dbupgrade', $is_check);
+$is_check = run_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다. 현재 DB 업그레이드가 완료된 상태입니다.';
?>
diff --git a/adm/member_form_update.php b/adm/member_form_update.php
index 54b90839b..89824f0a1 100644
--- a/adm/member_form_update.php
+++ b/adm/member_form_update.php
@@ -33,9 +33,14 @@ if($_POST['mb_certify_case'] && $_POST['mb_certify']) {
$mb_zip1 = substr($_POST['mb_zip'], 0, 3);
$mb_zip2 = substr($_POST['mb_zip'], 3);
+$mb_email = isset($_POST['mb_email']) ? get_email_address(trim($_POST['mb_email'])) : '';
+$mb_nick = isset($_POST['mb_nick']) ? trim(strip_tags($_POST['mb_nick'])) : '';
+
+if ($msg = valid_mb_nick($mb_nick)) alert($msg, "", true, true);
+
$sql_common = " mb_name = '{$_POST['mb_name']}',
- mb_nick = '{$_POST['mb_nick']}',
- mb_email = '{$_POST['mb_email']}',
+ mb_nick = '{$mb_nick}',
+ mb_email = '{$mb_email}',
mb_homepage = '{$_POST['mb_homepage']}',
mb_tel = '{$_POST['mb_tel']}',
mb_hp = '{$mb_hp}',
@@ -74,13 +79,13 @@ if ($w == '')
alert('이미 존재하는 회원아이디입니다.\\nID : '.$mb['mb_id'].'\\n이름 : '.$mb['mb_name'].'\\n닉네임 : '.$mb['mb_nick'].'\\n메일 : '.$mb['mb_email']);
// 닉네임중복체크
- $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$_POST['mb_nick']}' ";
+ $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 닉네임입니다.\\nID : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
// 이메일중복체크
- $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$_POST['mb_email']}' ";
+ $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 이메일입니다.\\nID : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
@@ -104,13 +109,13 @@ else if ($w == 'u')
alert($mb['mb_id'].' : 로그인 중인 관리자 레벨은 수정 할 수 없습니다.');
// 닉네임중복체크
- $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$_POST['mb_nick']}' and mb_id <> '$mb_id' ";
+ $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' and mb_id <> '$mb_id' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 닉네임입니다.\\nID : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
// 이메일중복체크
- $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$_POST['mb_email']}' and mb_id <> '$mb_id' ";
+ $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' and mb_id <> '$mb_id' ";
$row = sql_fetch($sql);
if ($row['mb_id'])
alert('이미 존재하는 이메일입니다.\\nID : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']);
@@ -228,7 +233,7 @@ else if ($w == 'u')
else
alert('제대로 된 값이 넘어오지 않았습니다.');
-start_event('admin_member_form_update', $w, $mb_id);
+run_event('admin_member_form_update', $w, $mb_id);
goto_url('./member_form.php?'.$qstr.'&w=u&mb_id='.$mb_id, false);
?>
\ No newline at end of file
diff --git a/adm/member_list_update.php b/adm/member_list_update.php
index 85b5efc53..7e250d4af 100644
--- a/adm/member_list_update.php
+++ b/adm/member_list_update.php
@@ -76,7 +76,7 @@ if ($msg)
//echo '';
alert($msg);
-start_event('admin_member_list_update', $_POST['act_button'], $mb_datas);
+run_event('admin_member_list_update', $_POST['act_button'], $mb_datas);
goto_url('./member_list.php?'.$qstr);
?>
diff --git a/adm/menu_list_update.php b/adm/menu_list_update.php
index 324f26209..3aaf18b11 100644
--- a/adm/menu_list_update.php
+++ b/adm/menu_list_update.php
@@ -23,7 +23,7 @@ for ($i=0; $i<$count; $i++)
$code = $_POST['code'][$i];
$me_name = $_POST['me_name'][$i];
- $me_link = preg_match('/^javascript/i', $_POST['me_link'][$i]) ? G5_URL : strip_tags($_POST['me_link'][$i]);
+ $me_link = (preg_match('/^javascript/i', $_POST['me_link'][$i]) || preg_match('/script:/i', $_POST['me_link'][$i])) ? G5_URL : strip_tags($_POST['me_link'][$i]);
if(!$code || !$me_name || !$me_link)
continue;
diff --git a/adm/point_list_delete.php b/adm/point_list_delete.php
index 5d59e942e..fb064b3bf 100644
--- a/adm/point_list_delete.php
+++ b/adm/point_list_delete.php
@@ -16,9 +16,11 @@ for ($i=0; $i<$count; $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
+ $po_id = (int) $_POST['po_id'][$k];
+ $str_mb_id = sql_real_escape_string($_POST['mb_id'][$k]);
// 포인트 내역정보
- $sql = " select * from {$g5['point_table']} where po_id = '{$_POST['po_id'][$k]}' ";
+ $sql = " select * from {$g5['point_table']} where po_id = '{$po_id}' ";
$row = sql_fetch($sql);
if(!$row['po_id'])
@@ -39,19 +41,19 @@ for ($i=0; $i<$count; $i++)
}
// 포인트 내역삭제
- $sql = " delete from {$g5['point_table']} where po_id = '{$_POST['po_id'][$k]}' ";
+ $sql = " delete from {$g5['point_table']} where po_id = '{$po_id}' ";
sql_query($sql);
// po_mb_point에 반영
$sql = " update {$g5['point_table']}
set po_mb_point = po_mb_point - '{$row['po_point']}'
- where mb_id = '{$_POST['mb_id'][$k]}'
- and po_id > '{$_POST['po_id'][$k]}' ";
+ where mb_id = '{$str_mb_id}'
+ and po_id > '{$po_id}' ";
sql_query($sql);
// 포인트 UPDATE
$sum_point = get_point_sum($_POST['mb_id'][$k]);
- $sql= " update {$g5['member_table']} set mb_point = '$sum_point' where mb_id = '{$_POST['mb_id'][$k]}' ";
+ $sql= " update {$g5['member_table']} set mb_point = '$sum_point' where mb_id = '{$str_mb_id}' ";
sql_query($sql);
}
diff --git a/adm/sms_admin/_common.php b/adm/sms_admin/_common.php
index 23e15e5ef..3c53259a8 100644
--- a/adm/sms_admin/_common.php
+++ b/adm/sms_admin/_common.php
@@ -13,6 +13,7 @@ if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) {
}
$sv = isset($_REQUEST['sv']) ? get_search_string($_REQUEST['sv']) : '';
+$st = (isset($_REQUEST['st']) && $st) ? substr(get_search_string($_REQUEST['st']), 0, 12) : '';
if( isset($token) ){
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
diff --git a/adm/sms_admin/emoticon_move.php b/adm/sms_admin/emoticon_move.php
index 075c7b4a4..4e04cf496 100644
--- a/adm/sms_admin/emoticon_move.php
+++ b/adm/sms_admin/emoticon_move.php
@@ -12,7 +12,7 @@ $g5['title'] = '이모티콘그룹 이동';
include_once(G5_PATH.'/head.sub.php');
$list = array(); //배열 변수 초기화
-$fo_no_list = isset($_POST['fo_no']) ? implode(',', $_POST['fo_no']) : '';
+$fo_no_list = isset($_POST['fo_no']) ? clean_xss_tags(strip_tags(implode(',', $_POST['fo_no']))) : '';
$sql = " select * from {$g5['sms5_form_group_table']} order by fg_no ";
$result = sql_query($sql);
diff --git a/adm/sms_admin/emoticon_move_update.php b/adm/sms_admin/emoticon_move_update.php
index aa1227f6a..8fe03b539 100644
--- a/adm/sms_admin/emoticon_move_update.php
+++ b/adm/sms_admin/emoticon_move_update.php
@@ -6,6 +6,8 @@ auth_check($auth[$sub_menu], "r");
if(!count($_POST['chk_fg_no']))
alert('이모티콘을 이동할 그룹을 한개 이상 선택해 주십시오.', $url);
+$fo_no_list = preg_replace('/[^a-zA-Z0-9\, ]/', '', $fo_no_list);
+
$sql = "select * from {$g5['sms5_form_table']} where fo_no in ($fo_no_list) order by fo_no desc ";
$result = sql_query($sql);
$save = array();
diff --git a/adm/sms_admin/form_group_update.php b/adm/sms_admin/form_group_update.php
index ee8b1627a..d5257dcea 100644
--- a/adm/sms_admin/form_group_update.php
+++ b/adm/sms_admin/form_group_update.php
@@ -11,8 +11,8 @@ if ($w == 'u') // 업데이트
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$fg_no = (int) $_POST['fg_no'][$k];
- $fg_name = strip_tags($_POST['fg_name'][$k]);
- $fg_member = strip_tags($_POST['fg_member'][$k]);
+ $fg_name = isset($_POST['fg_name'][$k]) ? addslashes(strip_tags($_POST['fg_name'][$k])) : '';
+ $fg_member = isset($_POST['fg_member'][$k]) ? addslashes(strip_tags($_POST['fg_member'][$k])) : '';
if (!is_numeric($fg_no))
alert('그룹 고유번호가 없습니다.');
@@ -83,7 +83,7 @@ else // 등록
if (!strlen(trim($fg_name)))
alert('그룹명을 입력해주세요');
- $fg_name = strip_tags($fg_name);
+ $fg_name = addslashes(strip_tags($fg_name));
$res = sql_fetch("select fg_name from {$g5['sms5_form_group_table']} where fg_name = '$fg_name'");
if ($res)
diff --git a/adm/sms_admin/history_num.php b/adm/sms_admin/history_num.php
index 530cfcdcd..043fdd3f0 100644
--- a/adm/sms_admin/history_num.php
+++ b/adm/sms_admin/history_num.php
@@ -11,6 +11,10 @@ $g5['title'] = "문자전송 내역 (번호별)";
if ($page < 1) $page = 1;
+if( isset($st) && !in_array($st, array('hs_name', 'hs_hp', 'bk_no')) ){
+ $st = '';
+}
+
if ($st && trim($sv))
$sql_search = " and $st like '%$sv%' ";
else
diff --git a/adm/sms_admin/history_view.php b/adm/sms_admin/history_view.php
index 2fd9d1b0c..498d7fe03 100644
--- a/adm/sms_admin/history_view.php
+++ b/adm/sms_admin/history_view.php
@@ -8,6 +8,10 @@ $colspan = 10;
$st = isset($st) ? strip_tags($st) : '';
$ssv = isset($ssv) ? strip_tags($ssv) : '';
+if( $st && !in_array($st, array('hs_name', 'hs_hp', 'bk_no')) ){
+ $st = '';
+}
+
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자전송 상세내역";
diff --git a/adm/sms_admin/num_book_move.php b/adm/sms_admin/num_book_move.php
index 0097f9150..f69248d89 100644
--- a/adm/sms_admin/num_book_move.php
+++ b/adm/sms_admin/num_book_move.php
@@ -31,8 +31,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|