diff --git a/adm/admin.lib.php b/adm/admin.lib.php index 7fdc00985..1ad01bab1 100644 --- a/adm/admin.lib.php +++ b/adm/admin.lib.php @@ -482,7 +482,7 @@ function admin_check_xss_params($params){ if( is_array($value) ){ admin_check_xss_params($value); - } else if ( preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/[onload|onerror]=.*/ius', $value)) ){ + } else if ( (preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/[onload|onerror]=.*/ius', $value))) || preg_match('/^(?=.*get_ajax_token\()(?=.*xmlhttprequest\()(?=.*send\().*$/im', $value) ){ alert('요청 쿼리에 잘못된 스크립트문장이 있습니다.\\nXSS 공격일수도 있습니다.'); die(); } diff --git a/adm/board_form.php b/adm/board_form.php index 3e60031d2..f75650a74 100644 --- a/adm/board_form.php +++ b/adm/board_form.php @@ -82,6 +82,7 @@ if (!isset($board['bo_use_captcha'])) { $required = ""; $readonly = ""; +$sound_only = ""; if ($w == '') { $html_title .= ' 생성'; diff --git a/bbs/db_table.optimize.php b/bbs/db_table.optimize.php index 828923029..97a2fd8fa 100644 --- a/bbs/db_table.optimize.php +++ b/bbs/db_table.optimize.php @@ -53,7 +53,7 @@ if($config['cf_leave_day'] > 0) { } // 음성 캡챠 파일 삭제 -$captcha_mp3 = glob(G5_PATH.'/data/cache/kcaptcha-*.mp3'); +$captcha_mp3 = glob(G5_DATA_PATH.'/cache/kcaptcha-*.mp3'); if($captcha_mp3 && is_array($captcha_mp3)) { foreach ($captcha_mp3 as $file) { if (filemtime($file) + 86400 < G5_SERVER_TIME) { diff --git a/bbs/download.php b/bbs/download.php index e4f7fa3fe..2b2aa1f2b 100644 --- a/bbs/download.php +++ b/bbs/download.php @@ -108,17 +108,17 @@ run_event('download_file_header', $file, $file_exist_check); if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) { header("content-type: doesn/matter"); - header("content-length: ".filesize("$filepath")); + header("content-length: ".filesize($filepath)); header("content-disposition: attachment; filename=\"$original\""); header("content-transfer-encoding: binary"); } else if (preg_match("/Firefox/i", $_SERVER['HTTP_USER_AGENT'])){ header("content-type: file/unknown"); - header("content-length: ".filesize("$filepath")); + header("content-length: ".filesize($filepath)); header("content-disposition: attachment; filename=\"".basename($file['bf_source'])."\""); header("content-description: php generated data"); } else { header("content-type: file/unknown"); - header("content-length: ".filesize("$filepath")); + header("content-length: ".filesize($filepath)); header("content-disposition: attachment; filename=\"$original\""); header("content-description: php generated data"); } diff --git a/bbs/qadownload.php b/bbs/qadownload.php index 3c1a838c0..b6f163ed7 100644 --- a/bbs/qadownload.php +++ b/bbs/qadownload.php @@ -22,21 +22,26 @@ if($is_guest) { $filepath = G5_DATA_PATH.'/qa/'.$file['qa_file'.$no]; $filepath = addslashes($filepath); -if (!is_file($filepath) || !file_exists($filepath)) +$file_exist_check = (!is_file($filepath) || !file_exists($filepath)) ? false : true; + +if ( false === run_replace('qa_download_file_exist_check', $file_exist_check, $file) ){ alert('파일이 존재하지 않습니다.'); +} $g5['title'] = '다운로드 > '.conv_subject($file['qa_subject'], 255); +run_event('qa_download_file_header', $file, $file_exist_check); + $original = urlencode($file['qa_source'.$no]); if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) { header("content-type: doesn/matter"); - header("content-length: ".filesize("$filepath")); + header("content-length: ".filesize($filepath)); header("content-disposition: attachment; filename=\"$original\""); header("content-transfer-encoding: binary"); } else { header("content-type: file/unknown"); - header("content-length: ".filesize("$filepath")); + header("content-length: ".filesize($filepath)); header("content-disposition: attachment; filename=\"$original\""); header("content-description: php generated data"); } diff --git a/bbs/write_update.php b/bbs/write_update.php index 3f50cc96a..723cb7857 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -466,9 +466,9 @@ for ($i=0; $ino_profile'); +define('G5_NO_PROFILE_IMG', 'no_profile'); // 썸네일 처리 방식, 비율유지 하지 않고 썸네일을 생성하려면 주석을 풀고 값은 false 입력합니다. ( true 또는 주석으로 된 경우에는 비율 유지합니다. ) //define('G5_USE_THUMB_RATIO', false); diff --git a/install/ajax.install.check.php b/install/ajax.install.check.php index fd5616f73..a6fc82f2c 100644 --- a/install/ajax.install.check.php +++ b/install/ajax.install.check.php @@ -15,6 +15,10 @@ if (file_exists($dbconfig_file)) { die(install_json_msg('프로그램이 이미 설치되어 있습니다.')); } +if (preg_match("/[^0-9a-z_]+/i", $_POST['table_prefix']) ) { + die(install_json_msg('TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.')); +} + $mysql_host = safe_install_string_check($_POST['mysql_host'], 'json'); $mysql_user = safe_install_string_check($_POST['mysql_user'], 'json'); $mysql_pass = safe_install_string_check($_POST['mysql_pass'], 'json'); diff --git a/install/install_config.php b/install/install_config.php index 6dd988989..a4aff0f04 100644 --- a/install/install_config.php +++ b/install/install_config.php @@ -61,7 +61,7 @@ $ajax_token = md5($tmp_str.$_SERVER['REMOTE_ADDR'].$_SERVER['DOCUMENT_ROOT']); - 가능한 변경하지 마십시오. + TABLE명 접두사는 영문자, 숫자, _ 만 입력 가능합니다. diff --git a/install/install_db.php b/install/install_db.php index 73539409b..20bbdbd9b 100644 --- a/install/install_db.php +++ b/install/install_db.php @@ -38,6 +38,10 @@ if (isset($_POST['g5_install'])) $g5_shop_prefix = $_POST['g5_shop_prefix']; $g5_shop_install= $_POST['g5_shop_install']; +if (preg_match("/[^0-9a-z_]+/i", $table_prefix) ) { + die('

TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.

'); +} + if (preg_match("/[^0-9a-z_]+/i", $admin_id)) { die('

관리자 아이디는 영문자, 숫자, _ 만 입력하세요.

'); } @@ -539,10 +543,10 @@ $f = @fopen($file, 'a'); fwrite($f, "); // 최대 $str = preg_replace("/\[\\]/i", "", $str); $c_reply_href = $comment_common_url.'&c_id='.$comment_id.'&w=c#bo_vc_w'; $c_edit_href = $comment_common_url.'&c_id='.$comment_id.'&w=cu#bo_vc_w'; + $is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0; ?>
style="margin-left:px;border-bottom-color:#f8f8f8">
@@ -37,6 +38,7 @@ var char_max = parseInt(); // 최대 +
    @@ -45,6 +47,7 @@ var char_max = parseInt(); // 최대
  • 삭제
+ ", $str); $c_reply_href = $comment_common_url.'&c_id='.$comment_id.'&w=c#bo_vc_w'; $c_edit_href = $comment_common_url.'&c_id='.$comment_id.'&w=cu#bo_vc_w'; + $is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0; ?>
style="margin-left:px;border-bottom-color:#f8f8f8">
@@ -37,6 +38,7 @@ var char_max = parseInt(); // 최대 +
    @@ -45,6 +47,7 @@ var char_max = parseInt(); // 최대
  • 삭제
+ + + + - - \ No newline at end of file + \ No newline at end of file diff --git a/skin/board/basic/write.skin.php b/skin/board/basic/write.skin.php index c62eca526..5e341d278 100644 --- a/skin/board/basic/write.skin.php +++ b/skin/board/basic/write.skin.php @@ -130,7 +130,7 @@ add_stylesheet('', 0 diff --git a/skin/board/gallery/view_comment.skin.php b/skin/board/gallery/view_comment.skin.php index c918445e3..704020f2b 100644 --- a/skin/board/gallery/view_comment.skin.php +++ b/skin/board/gallery/view_comment.skin.php @@ -26,6 +26,7 @@ var char_max = parseInt(); // 최대 $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결 $c_reply_href = $comment_common_url.'&c_id='.$comment_id.'&w=c#bo_vc_w'; $c_edit_href = $comment_common_url.'&c_id='.$comment_id.'&w=cu#bo_vc_w'; + $is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0; ?>
style="margin-left:px;border-top-color:#e0e0e0"> @@ -53,7 +54,7 @@ var char_max = parseInt(); // 최대 비밀글

- ); // 최대 " id="secret_comment_">
+
    @@ -78,6 +80,7 @@ var char_max = parseInt(); // 최대
  • 삭제
+ + + + - - \ No newline at end of file + \ No newline at end of file diff --git a/skin/board/gallery/write.skin.php b/skin/board/gallery/write.skin.php index 3e3617db6..a99b79000 100644 --- a/skin/board/gallery/write.skin.php +++ b/skin/board/gallery/write.skin.php @@ -128,7 +128,7 @@ add_stylesheet('', 0 diff --git a/theme/basic/mobile/skin/board/basic/view_comment.skin.php b/theme/basic/mobile/skin/board/basic/view_comment.skin.php index 6ff08887b..eda34f3fa 100644 --- a/theme/basic/mobile/skin/board/basic/view_comment.skin.php +++ b/theme/basic/mobile/skin/board/basic/view_comment.skin.php @@ -22,6 +22,7 @@ var char_max = parseInt(); // 최대 $str = preg_replace("/\[\\]/i", "", $str); $c_reply_href = $comment_common_url.'&c_id='.$comment_id.'&w=c#bo_vc_w'; $c_edit_href = $comment_common_url.'&c_id='.$comment_id.'&w=cu#bo_vc_w'; + $is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0; ?>
style="margin-left:px;border-bottom-color:#f8f8f8">
@@ -37,6 +38,7 @@ var char_max = parseInt(); // 최대 +
    @@ -45,6 +47,7 @@ var char_max = parseInt(); // 최대
  • 삭제
+ ", $str); $c_reply_href = $comment_common_url.'&c_id='.$comment_id.'&w=c#bo_vc_w'; $c_edit_href = $comment_common_url.'&c_id='.$comment_id.'&w=cu#bo_vc_w'; + $is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0; ?>
style="margin-left:px;border-bottom-color:#f8f8f8">
@@ -37,6 +38,7 @@ var char_max = parseInt(); // 최대 +
    @@ -45,6 +47,7 @@ var char_max = parseInt(); // 최대
  • 삭제
+ + + + - - \ No newline at end of file + \ No newline at end of file diff --git a/theme/basic/skin/board/basic/write.skin.php b/theme/basic/skin/board/basic/write.skin.php index c62eca526..5e341d278 100644 --- a/theme/basic/skin/board/basic/write.skin.php +++ b/theme/basic/skin/board/basic/write.skin.php @@ -130,7 +130,7 @@ add_stylesheet('', 0 diff --git a/theme/basic/skin/board/gallery/view_comment.skin.php b/theme/basic/skin/board/gallery/view_comment.skin.php index c918445e3..0c856557a 100644 --- a/theme/basic/skin/board/gallery/view_comment.skin.php +++ b/theme/basic/skin/board/gallery/view_comment.skin.php @@ -26,6 +26,7 @@ var char_max = parseInt(); // 최대 $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결 $c_reply_href = $comment_common_url.'&c_id='.$comment_id.'&w=c#bo_vc_w'; $c_edit_href = $comment_common_url.'&c_id='.$comment_id.'&w=cu#bo_vc_w'; + $is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0; ?>
style="margin-left:px;border-top-color:#e0e0e0"> @@ -53,7 +54,7 @@ var char_max = parseInt(); // 최대 비밀글

- ); // 최대 " id="secret_comment_">
+
    @@ -78,6 +80,7 @@ var char_max = parseInt(); // 최대
  • 삭제
+ + + + - - \ No newline at end of file + \ No newline at end of file diff --git a/theme/basic/skin/board/gallery/write.skin.php b/theme/basic/skin/board/gallery/write.skin.php index 3e3617db6..a99b79000 100644 --- a/theme/basic/skin/board/gallery/write.skin.php +++ b/theme/basic/skin/board/gallery/write.skin.php @@ -128,7 +128,7 @@ add_stylesheet('', 0