From 254583a135d6734713296355d9709de14fc2b25e Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 12 Apr 2017 16:22:59 +0900 Subject: [PATCH 01/10] =?UTF-8?q?=EC=9D=B4=EB=A9=94=EC=9D=BC=20=EB=B3=B5?= =?UTF-8?q?=ED=99=94=ED=99=94=20=EB=AC=B8=EC=9E=90=EC=97=B4=EC=9D=B4=20?= =?UTF-8?q?=EA=B9=A8=EC=A7=80=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index 1d74cb403..7785a2cd2 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3197,7 +3197,7 @@ class str_encrypt function __construct($salt='') { if(!$salt) - $this->salt = md5(G5_MYSQL_PASSWORD); + $this->salt = md5(preg_replace('/[^0-9A-Za-z]/', substr(G5_MYSQL_USER, -1), G5_MYSQL_PASSWORD)); else $this->salt = $salt; From edef3b961a9d52e8448d6a18243a56bcb6115e7c Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 17 May 2017 14:09:05 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=EB=A9=94=EB=89=B4=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20=EB=8C=80=EC=83=81=EC=97=90=EC=84=9C=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=ED=8C=90=EC=9D=BC=20=EA=B2=BD=EC=9A=B0=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=ED=8C=90=20=EA=B7=B8=EB=A3=B9=20=ED=91=9C=EC=8B=9C=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20#73?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/css/admin.css | 1 + adm/menu_form.php | 50 +++++++++++++++++++++++++++++++++++++--- adm/menu_form_search.php | 19 +++++++++++++-- lib/common.lib.php | 21 +++++++++++++++++ 4 files changed, 86 insertions(+), 5 deletions(-) diff --git a/adm/css/admin.css b/adm/css/admin.css index 4028c3b63..be142eda0 100644 --- a/adm/css/admin.css +++ b/adm/css/admin.css @@ -311,6 +311,7 @@ tfoot td {font-weight:bold;text-align:center} #menu_frm #menu_result {margin:20px 0} #menulist .sub_menu_class {padding-left:25px;background:url('../img/sub_menu_ico.gif') 5px 15px no-repeat} +.exist_menu_link {font-weight:bold;color:red} /* 회원관리 목록 */ .mb_leave_msg {color:#b6b6b6} diff --git a/adm/menu_form.php b/adm/menu_form.php index 0db45d575..15592bd33 100644 --- a/adm/menu_form.php +++ b/adm/menu_form.php @@ -43,13 +43,57 @@ $(function() { "./menu_form_search.php" ); - $("#me_type").on("change", function() { - var type = $(this).val(); + function link_checks_all_chage(){ + + var $links = $(opener.document).find("#menulist input[name='me_link[]']"), + $o_link = $(".td_mngsmall input[name='link[]']"), + hrefs = [], + menu_exist = false; + + if( $links.length ){ + $links.each(function( index ) { + hrefs.push( $(this).val() ); + }); + + $o_link.each(function( index ) { + if( $.inArray( $(this).val(), hrefs ) != -1 ){ + $(this).closest("tr").find("td:eq( 0 )").addClass("exist_menu_link"); + menu_exist = true; + } + }); + } + + if( menu_exist ){ + $(".menu_exists_tip").show(); + } else { + $(".menu_exists_tip").hide(); + } + } + + function menu_result_change( type ){ + + var dfd = new $.Deferred(); $("#menu_result").empty().load( "./menu_form_search.php", - { type : type } + { type : type }, + function(){ + dfd.resolve('Finished'); + } ); + + return dfd.promise(); + } + + $("#me_type").on("change", function() { + var type = $(this).val(); + + var promise = menu_result_change( type ); + + promise.done(function(message) { + link_checks_all_chage(type); + }); + }); $(document).on("click", "#add_manual", function() { diff --git a/adm/menu_form_search.php b/adm/menu_form_search.php index 1d5ff3ee7..c11c6288e 100644 --- a/adm/menu_form_search.php +++ b/adm/menu_form_search.php @@ -11,7 +11,7 @@ switch($type) { order by gr_order, gr_id "; break; case 'board': - $sql = " select bo_table as id, bo_subject as subject + $sql = " select bo_table as id, bo_subject as subject, gr_id from {$g5['board_table']} order by bo_order, bo_table "; break; @@ -32,13 +32,18 @@ if($sql) { for($i=0; $row=sql_fetch_array($result); $i++) { if($i == 0) { + + $bbs_subject_title = ($type == 'board') ? '게시판제목' : '제목'; ?>
- + + + + @@ -63,6 +68,12 @@ if($sql) { + + +
제목게시판 그룹 선택
"> @@ -76,6 +87,10 @@ if($sql) {
+ +
diff --git a/lib/common.lib.php b/lib/common.lib.php index 7785a2cd2..65fd95d66 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3260,6 +3260,27 @@ function check_write_token($bo_table) return true; } +function get_call_func_cache($func, $args=array()){ + + static $cache = array(); + + $key = md5(serialize($args)); + + if( isset($cache[$func]) && isset($cache[$func][$key]) ){ + return $cache[$func][$key]; + } + + $result = null; + + try{ + $cache[$func][$key] = $result = call_user_func_array($func, $args); + } catch (Exception $e) { + return null; + } + + return $result; +} + // include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다. function is_include_path_check($path='') { From cecc1632302ee554a4dd369c39e1d929f791a4b7 Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 19 May 2017 14:52:47 +0900 Subject: [PATCH 03/10] =?UTF-8?q?=EA=B8=B0=ED=83=80=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.php | 2 +- theme/basic/head.sub.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common.php b/common.php index 6eb591997..608a779ac 100644 --- a/common.php +++ b/common.php @@ -370,7 +370,7 @@ if ($_SESSION['ss_mb_id']) { // 로그인중이라면 $key = md5($_SERVER['SERVER_ADDR'] . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $row['mb_password']); // 쿠키에 저장된 키와 같다면 $tmp_key = get_cookie('ck_auto'); - if ($tmp_key == $key && $tmp_key) { + if ($tmp_key === $key && $tmp_key) { // 차단, 탈퇴가 아니고 메일인증이 사용이면서 인증을 받았다면 if ($row['mb_intercept_date'] == '' && $row['mb_leave_date'] == '' && diff --git a/theme/basic/head.sub.php b/theme/basic/head.sub.php index 64a552e6c..a282caaf2 100644 --- a/theme/basic/head.sub.php +++ b/theme/basic/head.sub.php @@ -39,7 +39,7 @@ if (G5_IS_MOBILE) { echo ''.PHP_EOL; } else { echo ''.PHP_EOL; - echo ''.PHP_EOL; + echo ''.PHP_EOL; } if($config['cf_add_meta']) From 746e04cf2388276fa18fd2931103b4ff06382206 Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 19 May 2017 15:57:27 +0900 Subject: [PATCH 04/10] =?UTF-8?q?install=20=ED=8C=8C=EC=9D=BC=EC=97=90=20u?= =?UTF-8?q?tf-8=20=ED=97=A4=EB=8D=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/index.php | 2 ++ install/install_config.php | 2 ++ install/install_db.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/install/index.php b/install/index.php index 056b399c0..990b5938a 100644 --- a/install/index.php +++ b/install/index.php @@ -1,4 +1,6 @@ Date: Fri, 19 May 2017 16:03:40 +0900 Subject: [PATCH 05/10] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=EC=8B=9C=20=ED=95=84=EB=93=9C=20=EC=86=8C=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index 65fd95d66..40023f690 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -628,7 +628,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op // SQL Injection 방지 // 필드값에 a-z A-Z 0-9 _ , | 이외의 값이 있다면 검색필드를 wr_subject 로 설정한다. - $field[$k] = preg_match("/^[\w\,\|]+$/", $field[$k]) ? $field[$k] : "wr_subject"; + $field[$k] = preg_match("/^[\w\,\|]+$/", $field[$k]) ? strtolower($field[$k]) : "wr_subject"; $str .= $op2; switch ($field[$k]) { From f70df1fff2aceaa466ef6936057bae8445497a8d Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 19 May 2017 18:15:35 +0900 Subject: [PATCH 06/10] =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20=ED=81=AC?= =?UTF-8?q?=EB=A1=AC=20=EB=B8=8C=EB=9D=BC=EC=9A=B0=EC=A0=80=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=BA=A1=EC=B1=A0=20=EC=A1=B0=ED=9A=8C=EC=88=98=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/kcaptcha/kcaptcha.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/kcaptcha/kcaptcha.lib.php b/plugin/kcaptcha/kcaptcha.lib.php index 61d15548c..ccf5e358d 100644 --- a/plugin/kcaptcha/kcaptcha.lib.php +++ b/plugin/kcaptcha/kcaptcha.lib.php @@ -245,7 +245,7 @@ function captcha_html($class="captcha") $html .= "\n".''; $html .= "\n".'
'; $html .= "\n".''; - if (is_mobile()) $html .= ''; + if (is_mobile()) $html .= ''; //$html .= "\n".''; $html .= "\n".''; if (!is_mobile()) $html .= "\n".''; From 674a7f3f57dbaf08635a398a0e6b015e195f0d1a Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 31 May 2017 15:42:51 +0900 Subject: [PATCH 07/10] =?UTF-8?q?g5=5Fpath=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common.php b/common.php index 608a779ac..da867ec16 100644 --- a/common.php +++ b/common.php @@ -32,10 +32,11 @@ function g5_path() $result['path'] = str_replace('\\', '/', dirname(__FILE__)); $tilde_remove = preg_replace('/^\/\~[^\/]+(.*)$/', '$1', $_SERVER['SCRIPT_NAME']); $document_root = str_replace($tilde_remove, '', $_SERVER['SCRIPT_FILENAME']); - $root = str_replace($document_root, '', $result['path']); + $pattern = '/' . preg_quote($document_root, '/') . '/i'; + $root = preg_replace($pattern, '', $result['path']); $port = $_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : ''; $http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 's' : '') . '://'; - $user = str_replace(str_replace($document_root, '', $_SERVER['SCRIPT_FILENAME']), '', $_SERVER['SCRIPT_NAME']); + $user = str_replace(preg_replace($pattern, '', $_SERVER['SCRIPT_FILENAME']), '', $_SERVER['SCRIPT_NAME']); $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; if(isset($_SERVER['HTTP_HOST']) && preg_match('/:[0-9]+$/', $host)) $host = preg_replace('/:[0-9]+$/', '', $host); From d755a425305bc94926adf567d7d5e298a8722358 Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 13 Jun 2017 15:20:28 +0900 Subject: [PATCH 08/10] =?UTF-8?q?=EA=B7=B8=EB=88=84=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EC=9B=90=EA=B2=A9=20=EC=B7=A8=EC=95=BD=EC=A0=90=2017-259=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/_common.php | 4 ++++ adm/sms_admin/_common.php | 4 ++++ lib/common.lib.php | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/adm/_common.php b/adm/_common.php index cd443b18e..074ed3b51 100644 --- a/adm/_common.php +++ b/adm/_common.php @@ -2,4 +2,8 @@ define('G5_IS_ADMIN', true); include_once ('../common.php'); include_once(G5_ADMIN_PATH.'/admin.lib.php'); + +if( isset($token) ){ + $token = @htmlspecialchars(strip_tags($token), ENT_QUOTES); +} ?> \ No newline at end of file diff --git a/adm/sms_admin/_common.php b/adm/sms_admin/_common.php index 7cf17b2b7..23e15e5ef 100644 --- a/adm/sms_admin/_common.php +++ b/adm/sms_admin/_common.php @@ -14,5 +14,9 @@ if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) { $sv = isset($_REQUEST['sv']) ? get_search_string($_REQUEST['sv']) : ''; +if( isset($token) ){ + $token = @htmlspecialchars(strip_tags($token), ENT_QUOTES); +} + add_stylesheet('', 0); ?> \ No newline at end of file diff --git a/lib/common.lib.php b/lib/common.lib.php index 40023f690..3da20636f 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3284,6 +3284,44 @@ function get_call_func_cache($func, $args=array()){ // include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다. function is_include_path_check($path='') { + if( $path ){ + try { + // whether $path is unix or not + $unipath = strlen($path)==0 || $path{0}!='/'; + $unc = substr($path,0,2)=='\\\\'?true:false; + // attempts to detect if path is relative in which case, add cwd + if(strpos($path,':') === false && $unipath && !$unc){ + $path=getcwd().DIRECTORY_SEPARATOR.$path; + if($path{0}=='/'){ + $unipath = false; + } + } + + // resolve path parts (single dot, double dot and double delimiters) + $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path); + $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); + $absolutes = array(); + foreach ($parts as $part) { + if ('.' == $part){ + continue; + } + if ('..' == $part) { + array_pop($absolutes); + } else { + $absolutes[] = $part; + } + } + $path = implode(DIRECTORY_SEPARATOR, $absolutes); + // resolve any symlinks + // put initial separator that could have been lost + $path = !$unipath ? '/'.$path : $path; + $path = $unc ? '\\\\'.$path : $path; + } catch (Exception $e) { + //echo 'Caught exception: ', $e->getMessage(), "\n"; + return false; + } + } + if( !$path || preg_match('/\/data\/(file|editor)\/[A-Za-z0-9_]{1,20}\//', $path) ){ return false; } From c9e85d31595dd541f5e25787ad1c5b926557d098 Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 13 Jun 2017 16:06:12 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=EA=B7=B8=EB=88=84=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C=20=EC=B7=A8=EC=95=BD?= =?UTF-8?q?=EC=A0=90=2017-282=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/editor/cheditor5/imageUpload/delete.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/editor/cheditor5/imageUpload/delete.php b/plugin/editor/cheditor5/imageUpload/delete.php index 0da4fc8f3..1d961c696 100644 --- a/plugin/editor/cheditor5/imageUpload/delete.php +++ b/plugin/editor/cheditor5/imageUpload/delete.php @@ -5,9 +5,9 @@ if(!function_exists('ft_nonce_is_valid')){ include_once('../editor.lib.php'); } -$filesrc = isset($_POST["filesrc"]) ? $_POST["filesrc"] : ''; +$filesrc = isset($_POST["filesrc"]) ? preg_replace("/[ #\&\+\-%@=\/\\\:;,\'\"\^`~\_|\!\?\*$#<>()\[\]\{\}]/", "", $_POST["filesrc"]) : ''; -if( !$filesrc ){ +if( !$filesrc || ! preg_match('=^[^/?*;:{}\\\\]+\.[^/?*;:{}\\\\]+$=', $filesrc) || ! preg_match('/\.(gif|jpe?g|bmp|png)$/i', $filesrc) ){ die( false ); } From 3ee82c38d588a8b5a699e62f3fcd85eb8348a0ab Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 14 Jun 2017 09:48:02 +0900 Subject: [PATCH 10/10] =?UTF-8?q?5.2.8=20=EB=B2=84=EC=A0=84=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.php b/config.php index 0e8ddd6f2..eee25e8c7 100644 --- a/config.php +++ b/config.php @@ -5,7 +5,7 @@ ********************/ define('G5_VERSION', '그누보드5'); -define('G5_GNUBOARD_VER', '5.2.7'); +define('G5_GNUBOARD_VER', '5.2.8'); // 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음 define('_GNUBOARD_', true);