diff --git a/AvocadoEdition_Light/adm/contentformupdate.php b/AvocadoEdition_Light/adm/contentformupdate.php index aca5754..d1e4c13 100644 --- a/AvocadoEdition_Light/adm/contentformupdate.php +++ b/AvocadoEdition_Light/adm/contentformupdate.php @@ -1,6 +1,6 @@ 관리자 모드에서 게시판관리->내용 관리를 먼저 확인해 주세요.'); } - - // 내용 $sql = " select * from {$g5['content_table']} where co_id = '$co_id' "; $co = sql_fetch($sql); @@ -18,10 +16,11 @@ $g5['title'] = $co['co_subject']; if (is_include_path_check($co['co_include_head'])) - @include_once($co['co_include_head']); + @include_once $co['co_include_head']; else - include_once('./_head.php'); + include_once './_head.php'; +$co['co_tag_filter_use'] = 1; $str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']); // $src 를 $dst 로 변환 diff --git a/AvocadoEdition_Light/lib/common.lib.php b/AvocadoEdition_Light/lib/common.lib.php index 2f9b93c..4f80a40 100644 --- a/AvocadoEdition_Light/lib/common.lib.php +++ b/AvocadoEdition_Light/lib/common.lib.php @@ -24,7 +24,8 @@ function get_microtime() // 한페이지에 보여줄 행, 현재페이지, 총페이지수, URL function get_paging($write_pages, $cur_page, $total_page, $url, $add = "") { - if (!$write_pages) $write_pages = 5; + if (!$write_pages) + $write_pages = 5; $url = preg_replace('#&page=[0-9]*#', '', $url) . '&page='; $str = ''; @@ -36,8 +37,9 @@ function get_paging($write_pages, $cur_page, $total_page, $url, $add = "") $start_page = (((int) (($cur_page - 1) / $write_pages)) * $write_pages) + 1; $end_page = $start_page + $write_pages - 1; - if ($end_page >= $total_page) $end_page = $total_page; - + if ($end_page >= $total_page) + $end_page = $total_page; + if ($start_page > 1) $str .= 'navigate_before' . PHP_EOL; @@ -1515,7 +1517,7 @@ function sql_query($sql, $error = G5_DISPLAY_SQL_ERROR, $link = null) if (preg_match("#^desc(?:ribe)?\s+(.*)#i", $sql)) { $sql = preg_replace_callback("#^desc(?:ribe)?\s+(.*)#i", '_callback_sql_show_tables', trim($sql)); } - + if (function_exists('mysqli_query') && G5_MYSQLI_USE) { if ($error) { $result = @mysqli_query($link, $sql) or die("
$sql
" . mysqli_errno($link) . " : " . mysqli_error($link) . "
error file : {$_SERVER['SCRIPT_NAME']}");
@@ -3406,24 +3408,80 @@ function get_write_token($bo_table)
// POST로 넘어온 토큰과 세션에 저장된 토큰 비교
function check_write_token($bo_table)
{
- /*if(!$bo_table)
- alert('올바른 방법으로 이용해 주십시오.', G5_URL);
-
- $token = get_session('ss_write_'.$bo_table.'_token');
- set_session('ss_write_'.$bo_table.'_token', '');
-
- if(!$token || !$_REQUEST['token'] || $token != $_REQUEST['token']) {
- alert('올바른 방법으로 이용해 주십시오.', G5_URL);
- }*/
-
+
return true;
}
-// include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다.
-function is_include_path_check($path = '')
+// include 하는 경로에 data file 경로나 안전하지 않은 경로가 있는지 체크합니다.
+function is_include_path_check($path = '', $is_input = '')
{
- if (!$path || preg_match('/\/data\/(file|editor)\/[A-Za-z0-9_]{1,20}\//', $path)) {
- return false;
+ if ($path) {
+ if ($is_input) {
+ // 장태진 @jtjisgod