그누보드5 버전 수정
This commit is contained in:
@ -382,17 +382,26 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 접근 권한 검사
|
||||
if (!$member['mb_id'])
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.');
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +62,11 @@ if ($_POST['act_button'] == "선택수정") {
|
||||
|
||||
// include 전에 $bo_table 값을 반드시 넘겨야 함
|
||||
$tmp_bo_table = trim($_POST['board_table'][$k]);
|
||||
|
||||
if( preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table) ){
|
||||
include ('./board_delete.inc.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
|
||||
|
||||
@ -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}{&to_date}={$to_date}";
|
||||
$qstr = "fr_date={$fr_date}&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}' ";
|
||||
|
||||
@ -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/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ if ($is_guest)
|
||||
$g5['title'] = '내 쪽지함';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
if (!$kind) $kind = 'recv';
|
||||
$kind = $kind ? clean_xss_tags(strip_tags($kind)) : 'recv';
|
||||
|
||||
if ($kind == 'recv')
|
||||
$unkind = 'send';
|
||||
|
||||
@ -115,7 +115,9 @@ while ($row = sql_fetch_array($result))
|
||||
if ($row3['bf_file'])
|
||||
{
|
||||
// 원본파일을 복사하고 퍼미션을 변경
|
||||
@copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$row3['bf_file']);
|
||||
// 제이프로님 코드제안 적용
|
||||
$copy_file_name = ($bo_table !== $move_bo_table) ? $row3['bf_file'] : $row2['wr_id'].'_copy_'.$insert_id.'_'.$row3['bf_file'];
|
||||
@copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$copy_file_name);
|
||||
@chmod($dst_dir/$row3['bf_file'], G5_FILE_PERMISSION);
|
||||
}
|
||||
|
||||
@ -124,7 +126,7 @@ while ($row = sql_fetch_array($result))
|
||||
wr_id = '$insert_id',
|
||||
bf_no = '{$row3['bf_no']}',
|
||||
bf_source = '".addslashes($row3['bf_source'])."',
|
||||
bf_file = '{$row3['bf_file']}',
|
||||
bf_file = '$copy_file_name',
|
||||
bf_download = '{$row3['bf_download']}',
|
||||
bf_content = '".addslashes($row3['bf_content'])."',
|
||||
bf_filesize = '{$row3['bf_filesize']}',
|
||||
|
||||
@ -69,7 +69,7 @@ for($i=0;$i<count($_POST['chk_bn_id']);$i++)
|
||||
|
||||
if ($pressed == '선택내용삭제') {
|
||||
// 게시글 내용만 삭제
|
||||
sql_query(" update $write_table set wr_subject = '{$g5['time_ymdhis']} - 본인 요청으로 인한 삭제 (냉무) ☆', wr_content = '', wr_name='본인요청삭제☆' where wr_id = '{$write['wr_id']}' ");
|
||||
sql_query(" update $write_table set wr_subject = '".G5_TIME_YMDHIS." - 본인 요청으로 인한 삭제 (냉무) ☆', wr_content = '', wr_name='본인요청삭제☆' where wr_id = '{$write['wr_id']}' ");
|
||||
} else {
|
||||
// 게시글 삭제
|
||||
sql_query(" delete from $write_table where wr_parent = '{$write['wr_id']}' ");
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
********************/
|
||||
|
||||
define('G5_VERSION', '그누보드5');
|
||||
define('G5_GNUBOARD_VER', '5.2.9.3');
|
||||
define('G5_GNUBOARD_VER', '5.2.9.5');
|
||||
define('G5_YOUNGCART_VER', '5.2.9.4');
|
||||
|
||||
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
|
||||
|
||||
@ -125,6 +125,7 @@ if($is_admin != 'super')
|
||||
<p>프로그램을 실행하시려면 그누보드4의 config.php 파일 경로를 입력하신 후 확인을 클릭해 주십시오.</p>
|
||||
|
||||
<form name="fimport" method="post" action="./g4_import_run.php" onsubmit="return fimport_submit(this);">
|
||||
<input type="hidden" name="token" value="" >
|
||||
<div id="g4_import_frm">
|
||||
<label for="file_path">config.php 파일 경로</label>
|
||||
<input type="text" name="file_path" id="file_path" required class="frm_input required">
|
||||
@ -142,6 +143,10 @@ if($is_admin != 'super')
|
||||
<script>
|
||||
function fimport_submit(f)
|
||||
{
|
||||
var token = get_write_token('g4_import');
|
||||
|
||||
f.token.value = token;
|
||||
|
||||
return confirm('그누보드4의 DB 데이터를 이전하시겠습니까?');
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -17,6 +17,13 @@ echo '<link rel="stylesheet" href="'.G5_URL.'/g4_import.css">';
|
||||
if(empty($_POST))
|
||||
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
|
||||
|
||||
if (!preg_match("/^http['s']?:\/\/".$_SERVER['HTTP_HOST']."/", $_SERVER['HTTP_REFERER'])){
|
||||
alert("제대로 된 접근이 아닌것 같습니다.", G5_URL);
|
||||
}
|
||||
|
||||
// 토큰체크
|
||||
check_write_token('g4_import');
|
||||
|
||||
if(get_session('tables_copied') == 'done')
|
||||
alert('DB 데이터 변환을 이미 실행하였습니다. 중복 실행시 오류가 발생할 수 있습니다.', G5_URL);
|
||||
|
||||
@ -165,7 +172,7 @@ document.onkeydown = noRefresh ;
|
||||
flush();
|
||||
|
||||
// g4의 confing.php
|
||||
require($g4_config_file);
|
||||
require('./'.$g4_config_file);
|
||||
|
||||
if(preg_replace('/[^a-z]/', '', strtolower($g4['charset'])) == 'euckr')
|
||||
$is_euckr = true;
|
||||
|
||||
@ -721,8 +721,13 @@ function get_write_token(bo_table)
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit", function() {
|
||||
$(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit, form[name=fwrite] input:image", function() {
|
||||
var f = this.form;
|
||||
|
||||
if (typeof(f.bo_table) == "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
var bo_table = f.bo_table.value;
|
||||
var token = get_write_token(bo_table);
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ function alert($msg='', $url='', $error=true, $post=false)
|
||||
global $g5, $config, $member;
|
||||
global $is_admin;
|
||||
|
||||
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
|
||||
$msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.';
|
||||
|
||||
$header = '';
|
||||
if (isset($g5['title'])) {
|
||||
@ -169,6 +169,8 @@ function alert_close($msg, $error=true)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$msg = strip_tags($msg, '<br>');
|
||||
|
||||
$header = '';
|
||||
if (isset($g5['title'])) {
|
||||
$header = $g5['title'];
|
||||
@ -3317,9 +3319,10 @@ function get_call_func_cache($func, $args=array()){
|
||||
}
|
||||
|
||||
// include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다.
|
||||
function is_include_path_check($path='')
|
||||
function is_include_path_check($path='', $is_input='')
|
||||
{
|
||||
if( $path ){
|
||||
if ($is_input){
|
||||
try {
|
||||
// whether $path is unix or not
|
||||
$unipath = strlen($path)==0 || $path{0}!='/';
|
||||
@ -3361,6 +3364,13 @@ function is_include_path_check($path='')
|
||||
}
|
||||
}
|
||||
|
||||
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||
|
||||
if($extension && preg_match('/(jpg|jpeg|png|gif|bmp|conf)$/', $extension)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user