XSS 취약점 수정 및 LMS 모듈 추가

This commit is contained in:
chicpro
2015-10-01 13:46:46 +09:00
parent 84009dc16c
commit 94cc7639a9
62 changed files with 1213 additions and 462 deletions

View File

@ -1,5 +1,8 @@
<?php
include_once('./_common.php');
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(!$is_admin)
alert('접근 권한이 없습니다.', G5_URL);
// 4.11
@include_once($board_skin_path.'/delete_all.head.skin.php');
@ -13,13 +16,16 @@ if ($wr_id) // 건별삭제
else // 일괄삭제
$tmp_array = $_POST['chk_wr_id'];
$chk_count = count($tmp_array);
if($chk_count > (G5_IS_MOBILE ? $board['bo_mobile_page_rows'] : $board['bo_page_rows']))
alert('올바른 방법으로 이용해 주십시오.');
// 사용자 코드 실행
@include_once($board_skin_path.'/delete_all.skin.php');
// 거꾸로 읽는 이유는 답변글부터 삭제가 되어야 하기 때문임
for ($i=count($tmp_array)-1; $i>=0; $i--)
for ($i=$chk_count-1; $i>=0; $i--)
{
$write = sql_fetch(" select * from $write_table where wr_id = '$tmp_array[$i]' ");

View File

@ -76,7 +76,8 @@ if (!get_session($ss_name))
$g5['title'] = '다운로드 &gt; '.conv_subject($write['wr_subject'], 255);
$original = urlencode($file['bf_source']);
//$original = urlencode($file['bf_source']);
$original = iconv('utf-8', 'euc-kr', $file['bf_source']); // SIR 잉끼님 제안코드
@include_once($board_skin_path.'/download.tail.skin.php');

View File

@ -55,7 +55,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="act" value="<?php echo $act ?>">
<input type="hidden" name="url" value="<?php echo clean_xss_tags($_SERVER['HTTP_REFERER']); ?>">
<input type="hidden" name="url" value="<?php echo get_text(clean_xss_tags($_SERVER['HTTP_REFERER'])); ?>">
<div class="tbl_head01 tbl_wrap">
<table>

View File

@ -17,7 +17,7 @@ if (!$mb['mb_open'] && $is_admin != 'super' && $member['mb_id'] != $mb_id)
$g5['title'] = $mb['mb_nick'].'님의 자기소개';
include_once(G5_PATH.'/head.sub.php');
$mb_nick = get_sideview($mb['mb_id'], $mb['mb_nick'], $mb['mb_email'], $mb['mb_homepage'], $mb['mb_open']);
$mb_nick = get_sideview($mb['mb_id'], get_text($mb['mb_nick']), $mb['mb_email'], $mb['mb_homepage'], $mb['mb_open']);
// 회원가입후 몇일째인지? + 1 은 당일을 포함한다는 뜻
$sql = " select (TO_DAYS('".G5_TIME_YMDHIS."') - TO_DAYS('{$mb['mb_datetime']}') + 1) as days ";

View File

@ -57,8 +57,7 @@ if(is_file($skin_file)) {
}
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && $qaconfig['qa_use_editor'] && !G5_IS_MOBILE) {
if ($config['cf_editor'] && $qaconfig['qa_use_editor'] && (!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)) {
$is_dhtml_editor = true;
}

View File

@ -300,33 +300,100 @@ if($w == '' || $w == 'a' || $w == 'r') {
// SMS 알림
if($config['cf_sms_use'] == 'icode' && $qaconfig['qa_use_sms']) {
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
if($config['cf_sms_type'] == 'LMS') {
include_once(G5_LIB_PATH.'/icode.lms.lib.php');
// 답변글은 질문 등록자에게 전송
if($w == 'a' && $write['qa_sms_recv'] && trim($write['qa_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 답변이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_send_number']);
$recv_number = preg_replace('/[^0-9]/', '', $write['qa_hp']);
$port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']);
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
// SMS 모듈 클래스 생성
if($port_setting !== false) {
// 답변글은 질문 등록자에게 전송
if($w == 'a' && $write['qa_sms_recv'] && trim($write['qa_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 답변이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_send_number']);
$recv_number = preg_replace('/[^0-9]/', '', $write['qa_hp']);
if($recv_number) {
$strDest = array();
$strDest[] = $recv_number;
$strCallBack = $send_number;
$strCaller = iconv_euckr(trim($config['cf_title']));
$strSubject = '';
$strURL = '';
$strData = iconv_euckr($sms_content);
$strDate = '';
$nCount = count($strDest);
$SMS = new LMS;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
$res = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
if($res) {
$SMS->Send();
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
}
// 문의글 등록시 관리자에게 전송
if(($w == '' || $w == 'r') && trim($qaconfig['qa_admin_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 문의글이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qa_hp);
$recv_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_admin_hp']);
if($recv_number) {
$strDest = array();
$strDest[] = $recv_number;
$strCallBack = $send_number;
$strCaller = iconv_euckr(trim($config['cf_title']));;
$strSubject = '';
$strURL = '';
$strData = iconv_euckr($sms_content);
$strDate = '';
$nCount = count($strDest);
$SMS = new LMS;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
$res = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
if($res) {
$SMS->Send();
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
}
}
}
} else {
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
// 문의글 등록시 관리자에게 전송
if(($w == '' || $w == 'r') && trim($qaconfig['qa_admin_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 문의글이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qa_hp);
$recv_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_admin_hp']);
// 답변글은 질문 등록자에게 전송
if($w == 'a' && $write['qa_sms_recv'] && trim($write['qa_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 답변이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_send_number']);
$recv_number = preg_replace('/[^0-9]/', '', $write['qa_hp']);
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
}
}
// 문의글 등록시 관리자에게 전송
if(($w == '' || $w == 'r') && trim($qaconfig['qa_admin_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 문의글이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qa_hp);
$recv_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_admin_hp']);
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
}
}
}
}

View File

@ -30,6 +30,9 @@ if ($w == "") {
alert('개인정보처리방침안내의 내용에 동의하셔야 회원가입 하실 수 있습니다.', G5_BBS_URL.'/register.php');
}
$agree = preg_replace('#[^0-9]#', '', $_POST['agree']);
$agree2 = preg_replace('#[^0-9]#', '', $_POST['agree2']);
$member['mb_birth'] = '';
$member['mb_sex'] = '';
$member['mb_name'] = '';

View File

@ -390,9 +390,17 @@ if ($is_guest) {
}
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && !G5_IS_MOBILE && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) {
$is_dhtml_editor_use = false;
$editor_content_js = '';
if(!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)
$is_dhtml_editor_use = true;
// 모바일에서는 G5_IS_MOBILE_DHTML_USE 설정에 따라 DHTML 에디터 적용
if ($config['cf_editor'] && $is_dhtml_editor_use && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) {
$is_dhtml_editor = true;
if(is_file(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/autosave.editor.js'))
$editor_content_js = '<script src="'.G5_EDITOR_URL.'/'.$config['cf_editor'].'/autosave.editor.js"></script>'.PHP_EOL;
}
$editor_html = editor_html('wr_content', $content, $is_dhtml_editor);
$editor_js = '';