그누보드5 버전 수정

This commit is contained in:
thisgun
2017-10-10 11:53:54 +09:00
15 changed files with 124 additions and 51 deletions

View File

@ -382,15 +382,24 @@ function admin_referer_check($return=false)
}
$p = @parse_url($referer);
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
$msg = '';
if($host != $p['host']) {
$msg = '올바른 방법으로 이용해 주십시오.';
}
if($return)
if( $p['path'] && ! preg_match( '/\/'.preg_quote(G5_ADMIN_DIR).'\//i', $p['path'] ) ){
$msg = '올바른 방법으로 이용해 주십시오';
}
if( $msg ){
if($return) {
return $msg;
else
} else {
alert($msg, G5_URL);
}
}
}

View File

@ -1,7 +1,7 @@
<?php
if (!defined('_GNUBOARD_')) exit;
$print_version = (defined('G5_IS_SHOP_ADMIN_PAGE') && defined('G5_YOUNGCART_VER')) ? 'Cart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
$print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
?>
<noscript>

View File

@ -21,7 +21,7 @@ if ($file = $_POST['bo_include_head']) {
$purl = parse_url($file);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('상단 파일 경로 php, html 파일이 아닙니다.');
alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.');
}
$_POST['bo_include_head'] = $file;
}
@ -30,16 +30,16 @@ if ($file = $_POST['bo_include_tail']) {
$purl = parse_url($file);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('하단 파일 경로 php, html 파일이 아닙니다.');
alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.');
}
$_POST['bo_include_tail'] = $file;
}
if(!is_include_path_check($_POST['bo_include_head'])) {
if(!is_include_path_check($_POST['bo_include_head'], 1)) {
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.');
}
if(!is_include_path_check($_POST['bo_include_tail'])) {
if(!is_include_path_check($_POST['bo_include_tail'], 1)) {
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.');
}

View File

@ -62,7 +62,10 @@ if ($_POST['act_button'] == "선택수정") {
// include 전에 $bo_table 값을 반드시 넘겨야 함
$tmp_bo_table = trim($_POST['board_table'][$k]);
include ('./board_delete.inc.php');
if( preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table) ){
include ('./board_delete.inc.php');
}
}

View File

@ -20,6 +20,22 @@ if ($co_timg_del) @unlink(G5_DATA_PATH."/content/{$co_id}_t");
$error_msg = '';
if( $co_include_head ){
$purl = parse_url($co_include_head);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.');
}
}
if( $co_include_tail ){
$purl = parse_url($co_include_tail);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.');
}
}
if( $co_include_head && ! is_include_path_check($co_include_head) ){
$co_include_head = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';

View File

@ -7,7 +7,7 @@ auth_check($auth[$sub_menu], 'r');
if (empty($fr_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $fr_date) ) $fr_date = G5_TIME_YMD;
if (empty($to_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $to_date) ) $to_date = G5_TIME_YMD;
$qstr = "fr_date={$fr_date}{&amp;to_date}={$to_date}";
$qstr = "fr_date={$fr_date}&amp;to_date={$to_date}";
$sql_common = " from {$g5['popular_table']} a ";
$sql_search = " where trim(pp_word) <> '' and pp_date between '{$fr_date}' and '{$to_date}' ";

View File

@ -10,12 +10,28 @@ check_admin_token();
$error_msg = '';
if( $qa_include_head && ! is_include_path_check($qa_include_head) ){
if( $qa_include_head ){
$purl = parse_url($qa_include_head);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.');
}
}
if( $qa_include_tail ){
$purl = parse_url($qa_include_tail);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.');
}
}
if( $qa_include_head && ! is_include_path_check($qa_include_head, 1) ){
$qa_include_head = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
}
if( $qa_include_tail && ! is_include_path_check($qa_include_tail) ){
if( $qa_include_tail && ! is_include_path_check($qa_include_tail, 1) ){
$qa_include_tail = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}