This commit is contained in:
Amberstone 2024-10-07 12:23:49 +09:00
parent f122633032
commit 6635183e56
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
45 changed files with 1307 additions and 1307 deletions

View file

@ -306,7 +306,7 @@ function icon($act, $link = '', $target = '_parent')
{ {
global $g5; global $g5;
$img = array('입력' => 'insert', '추가' => 'insert', '생성' => 'insert', '수정' => 'modify', '삭제' => 'delete', '이동' => 'move', '그룹' => 'move', '보기' => 'view', '미리보기' => 'view', '복사' => 'copy'); $img =['입력' => 'insert', '추가' => 'insert', '생성' => 'insert', '수정' => 'modify', '삭제' => 'delete', '이동' => 'move', '그룹' => 'move', '보기' => 'view', '미리보기' => 'view', '복사' => 'copy'];
$icon = '<img src="' . G5_ADMIN_PATH . '/img/icon_' . $img[$act] . '.gif" title="' . $act . '">'; $icon = '<img src="' . G5_ADMIN_PATH . '/img/icon_' . $img[$act] . '.gif" title="' . $act . '">';
if ($link) if ($link)
$s = '<a href="' . $link . '">' . $icon . '</a>'; $s = '<a href="' . $link . '">' . $icon . '</a>';

View file

@ -984,7 +984,7 @@ $pg_anchor = '<ul class="anchor">
return false; return false;
} }
var field = Array('bo_gallery_cols', 'bo_gallery_width', 'bo_gallery_height', 'bo_mobile_gallery_width', 'bo_mobile_gallery_height', 'bo_image_width'); var field = ['bo_gallery_cols', 'bo_gallery_width', 'bo_gallery_height', 'bo_mobile_gallery_width', 'bo_mobile_gallery_height', 'bo_image_width'];
var count = field.length; var count = field.length;
var key; var key;

View file

@ -165,8 +165,8 @@ $f = @fopen($file, 'w');
@chmod($file, G5_FILE_PERMISSION); @chmod($file, G5_FILE_PERMISSION);
// 분류에 & 나 = 는 사용이 불가하므로 2바이트로 바꾼다. // 분류에 & 나 = 는 사용이 불가하므로 2바이트로 바꾼다.
$src_char = array('&', '='); $src_char =['&', '='];
$dst_char = array('', '〓'); $dst_char =['', '〓'];
$bo_category_list = str_replace($src_char, $dst_char, $bo_category_list); $bo_category_list = str_replace($src_char, $dst_char, $bo_category_list);
$sql_common = " gr_id = '{$_POST['gr_id']}', $sql_common = " gr_id = '{$_POST['gr_id']}',
@ -285,8 +285,8 @@ if ($w == '') {
$create_table = $g5['write_prefix'] . $bo_table; $create_table = $g5['write_prefix'] . $bo_table;
// sql_board.sql 파일의 테이블명을 변환 // sql_board.sql 파일의 테이블명을 변환
$source = array('/__TABLE_NAME__/', '/;/'); $source = ['/__TABLE_NAME__/', '/;/'];
$target = array($create_table, ''); $target = [$create_table, ''];
$sql = preg_replace($source, $target, $sql); $sql = preg_replace($source, $target, $sql);
sql_query($sql, FALSE); sql_query($sql, FALSE);

View file

@ -786,7 +786,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
return false; return false;
} }
var field = Array('cf_member_skin', 'cf_mobile_member_skin', 'cf_new_skin', 'cf_mobile_new_skin', 'cf_search_skin', 'cf_mobile_search_skin', 'cf_connect_skin', 'cf_mobile_connect_skin', 'cf_faq_skin', 'cf_mobile_faq_skin'); var field = ['cf_member_skin', 'cf_mobile_member_skin', 'cf_new_skin', 'cf_mobile_new_skin', 'cf_search_skin', 'cf_mobile_search_skin', 'cf_connect_skin', 'cf_mobile_connect_skin', 'cf_faq_skin', 'cf_mobile_faq_skin'];
var count = field.length; var count = field.length;
var key; var key;

View file

@ -38,7 +38,7 @@ $result = sql_query($sql);
$listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>'; $listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>';
$mb = array(); $mb = [];
$g5['title'] = '커플 관리'; $g5['title'] = '커플 관리';
include_once './admin.head.php'; include_once './admin.head.php';

View file

@ -52,7 +52,7 @@ $result = sql_query($sql);
$listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>'; $listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>';
$mb = array(); $mb = [];
if ($sfl == 'mb_id' && $stx) if ($sfl == 'mb_id' && $stx)
$mb = get_member($stx); $mb = get_member($stx);

View file

@ -47,7 +47,7 @@ $result = sql_query($sql);
$listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>'; $listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>';
$ch = array(); $ch = [];
if ($sfl == 'ch_id' && $stx) if ($sfl == 'ch_id' && $stx)
$ch = get_member($stx); $ch = get_member($stx);

View file

@ -65,7 +65,7 @@ for ($i = 1; $i <= 10; $i++) {
} }
foreach ($check_keys as $key) { foreach ($check_keys as $key) {
if (in_array($key, array('mb_signature', 'mb_profile'))) { if (in_array($key, ['mb_signature', 'mb_profile'])) {
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1, 0, 0) : ''; $posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1, 0, 0) : '';
} else { } else {
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : ''; $posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : '';

View file

@ -87,8 +87,8 @@ $colspan = 11;
$sub_menu_ico = '<span class="sub_menu_ico"></span>'; $sub_menu_ico = '<span class="sub_menu_ico"></span>';
} }
$search = array('"', "'"); $search = ['"', "'"];
$replace = array('&#034;', '&#039;'); $replace = ['&#034;', '&#039;'];
$me_name = str_replace($search, $replace, $row['me_name']); $me_name = str_replace($search, $replace, $row['me_name']);
?> ?>
<tr class="<?php echo $bg; ?> menu_list menu_group_<?php echo substr($row['me_code'], 0, 2); ?>" <tr class="<?php echo $bg; ?> menu_list menu_group_<?php echo substr($row['me_code'], 0, 2); ?>"

View file

@ -47,7 +47,7 @@ $frm_submit .= '</div>';
/** 세력 정보 **/ /** 세력 정보 **/
if ($config['cf_side_title']) { if ($config['cf_side_title']) {
$ch_si = array(); $ch_si = [];
$side_result = sql_query("select si_id, si_name from {$g5['side_table']} where si_auth <= '{$member['mb_level']}' order by si_id asc"); $side_result = sql_query("select si_id, si_name from {$g5['side_table']} where si_auth <= '{$member['mb_level']}' order by si_id asc");
for ($i = 0; $row = sql_fetch_array($side_result); $i++) { for ($i = 0; $row = sql_fetch_array($side_result); $i++) {
$ch_si[$i]['name'] = $row['si_name']; $ch_si[$i]['name'] = $row['si_name'];
@ -57,7 +57,7 @@ if ($config['cf_side_title']) {
/** 종족 정보 **/ /** 종족 정보 **/
if ($config['cf_class_title']) { if ($config['cf_class_title']) {
$ch_cl = array(); $ch_cl = [];
$class_result = sql_query("select cl_id, cl_name from {$g5['class_table']} where cl_auth <= '{$member['mb_level']}' order by cl_id asc"); $class_result = sql_query("select cl_id, cl_name from {$g5['class_table']} where cl_auth <= '{$member['mb_level']}' order by cl_id asc");
for ($i = 0; $row = sql_fetch_array($class_result); $i++) { for ($i = 0; $row = sql_fetch_array($class_result); $i++) {
$ch_cl[$i]['name'] = $row['cl_name']; $ch_cl[$i]['name'] = $row['cl_name'];

View file

@ -20,14 +20,14 @@ if (!in_array($config['cf_theme'], $theme_dir)) {
} }
$type = $_POST['type']; $type = $_POST['type'];
$arr_type = array('board', 'conf_skin', 'conf_member', 'shop_skin', 'shop_pc_index', 'shop_mobile_index', 'shop_etc', 'shop_event', 'shop_category'); $arr_type = ['board', 'conf_skin', 'conf_member', 'shop_skin', 'shop_pc_index', 'shop_mobile_index', 'shop_etc', 'shop_event', 'shop_category'];
if (!in_array($type, $arr_type)) { if (!in_array($type, $arr_type)) {
$data['error'] = '올바른 방법으로 이용해 주십시오.'; $data['error'] = '올바른 방법으로 이용해 주십시오.';
die(json_encode($data)); die(json_encode($data));
} }
if ($type == 'board') { if ($type == 'board') {
$keys = run_replace('theme_config_load_keys', array('bo_gallery_cols', 'bo_gallery_width', 'bo_gallery_height', 'bo_mobile_gallery_width', 'bo_mobile_gallery_height', 'bo_image_width'), $type); $keys = run_replace('theme_config_load_keys', ['bo_gallery_cols', 'bo_gallery_width', 'bo_gallery_height', 'bo_mobile_gallery_width', 'bo_mobile_gallery_height', 'bo_image_width'], $type);
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys)); $tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
$i = 0; $i = 0;
@ -41,7 +41,7 @@ if ($type == 'board') {
if ($i == 0) if ($i == 0)
$data['error'] = '적용할 게시판 이미지 설정이 없습니다.'; $data['error'] = '적용할 게시판 이미지 설정이 없습니다.';
} else if ($type == 'conf_skin') { } else if ($type == 'conf_skin') {
$keys = run_replace('theme_config_load_keys', array('cf_new_skin', 'cf_mobile_new_skin', 'cf_search_skin', 'cf_mobile_search_skin', 'cf_connect_skin', 'cf_mobile_connect_skin', 'cf_faq_skin', 'cf_mobile_faq_skin'), $type); $keys = run_replace('theme_config_load_keys', ['cf_new_skin', 'cf_mobile_new_skin', 'cf_search_skin', 'cf_mobile_search_skin', 'cf_connect_skin', 'cf_mobile_connect_skin', 'cf_faq_skin', 'cf_mobile_faq_skin'], $type);
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys)); $tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
@ -56,7 +56,7 @@ if ($type == 'board') {
if ($i == 0) if ($i == 0)
$data['error'] = '적용할 기본환경 스킨 설정이 없습니다.'; $data['error'] = '적용할 기본환경 스킨 설정이 없습니다.';
} else if ($type == 'conf_member') { } else if ($type == 'conf_member') {
$keys = run_replace('theme_config_load_keys', array('cf_member_skin', 'cf_mobile_member_skin'), $type); $keys = run_replace('theme_config_load_keys', ['cf_member_skin', 'cf_mobile_member_skin'], $type);
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys)); $tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
@ -71,7 +71,7 @@ if ($type == 'board') {
if ($i == 0) if ($i == 0)
$data['error'] = '적용할 기본환경 회원스킨 설정이 없습니다.'; $data['error'] = '적용할 기본환경 회원스킨 설정이 없습니다.';
} else if ($type == 'shop_skin') { } else if ($type == 'shop_skin') {
$keys = run_replace('theme_config_load_keys', array('de_shop_skin', 'de_shop_mobile_skin'), $type); $keys = run_replace('theme_config_load_keys', ['de_shop_skin', 'de_shop_mobile_skin'], $type);
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys)); $tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
@ -134,7 +134,7 @@ if ($type == 'board') {
if ($i == 0) if ($i == 0)
$data['error'] = '적용할 테마 설정이 없습니다.'; $data['error'] = '적용할 테마 설정이 없습니다.';
} else if ($type == 'shop_etc') { } else if ($type == 'shop_etc') {
$keys = run_replace('theme_config_load_keys', array('de_rel_list_use', 'de_rel_list_skin', 'de_rel_list_mod', 'de_rel_img_width', 'de_rel_img_height', 'de_mobile_rel_list_use', 'de_mobile_rel_list_skin', 'de_mobile_rel_list_mod', 'de_mobile_rel_img_width', 'de_mobile_rel_img_height', 'de_search_list_skin', 'de_search_list_mod', 'de_search_list_row', 'de_search_img_width', 'de_search_img_height', 'de_mobile_search_list_skin', 'de_mobile_search_list_mod', 'de_mobile_search_list_row', 'de_mobile_search_img_width', 'de_mobile_search_img_height', 'de_mimg_width', 'de_mimg_height', 'de_listtype_list_mod', 'de_listtype_list_row', 'de_mobile_listtype_list_mod', 'de_mobile_listtype_list_row'), $type); $keys = run_replace('theme_config_load_keys', ['de_rel_list_use', 'de_rel_list_skin', 'de_rel_list_mod', 'de_rel_img_width', 'de_rel_img_height', 'de_mobile_rel_list_use', 'de_mobile_rel_list_skin', 'de_mobile_rel_list_mod', 'de_mobile_rel_img_width', 'de_mobile_rel_img_height', 'de_search_list_skin', 'de_search_list_mod', 'de_search_list_row', 'de_search_img_width', 'de_search_img_height', 'de_mobile_search_list_skin', 'de_mobile_search_list_mod', 'de_mobile_search_list_row', 'de_mobile_search_img_width', 'de_mobile_search_img_height', 'de_mimg_width', 'de_mimg_height', 'de_listtype_list_mod', 'de_listtype_list_row', 'de_mobile_listtype_list_mod', 'de_mobile_listtype_list_row'], $type);
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys)); $tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
@ -149,7 +149,7 @@ if ($type == 'board') {
if ($i == 0) if ($i == 0)
$data['error'] = '적용할 테마 설정이 없습니다.'; $data['error'] = '적용할 테마 설정이 없습니다.';
} else if ($type == 'shop_event') { } else if ($type == 'shop_event') {
$keys = run_replace('theme_config_load_keys', array('ev_skin', 'ev_img_width', 'ev_img_height', 'ev_list_mod', 'ev_list_row', 'ev_mobile_skin', 'ev_mobile_img_width', 'ev_mobile_img_height', 'ev_mobile_list_mod', 'ev_mobile_list_row'), $type); $keys = run_replace('theme_config_load_keys', ['ev_skin', 'ev_img_width', 'ev_img_height', 'ev_list_mod', 'ev_list_row', 'ev_mobile_skin', 'ev_mobile_img_width', 'ev_mobile_img_height', 'ev_mobile_list_mod', 'ev_mobile_list_row'], $type);
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys)); $tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
@ -164,7 +164,7 @@ if ($type == 'board') {
if ($i == 0) if ($i == 0)
$data['error'] = '적용할 테마 설정이 없습니다.'; $data['error'] = '적용할 테마 설정이 없습니다.';
} else if ($type == 'shop_category') { } else if ($type == 'shop_category') {
$keys = run_replace('theme_config_load_keys', array('ca_skin', 'ca_img_width', 'ca_img_height', 'ca_list_mod', 'ca_list_row', 'ca_mobile_skin', 'ca_mobile_img_width', 'ca_mobile_img_height', 'ca_mobile_list_mod', 'ca_mobile_list_row'), $type); $keys = run_replace('theme_config_load_keys', ['ca_skin', 'ca_img_width', 'ca_img_height', 'ca_list_mod', 'ca_list_row', 'ca_mobile_skin', 'ca_mobile_img_width', 'ca_mobile_img_height', 'ca_mobile_list_mod', 'ca_mobile_list_row'], $type);
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys)); $tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));

View file

@ -9,7 +9,7 @@ if (!$theme || !in_array($theme, $theme_dir))
$info = get_theme_info($theme); $info = get_theme_info($theme);
$arr_mode = array('index', 'list', 'view', 'shop', 'ca_list', 'item'); $arr_mode = ['index', 'list', 'view', 'shop', 'ca_list', 'item'];
$mode = isset($_GET['mode']) ? substr(strip_tags($_GET['mode']), 0, 20) : ''; $mode = isset($_GET['mode']) ? substr(strip_tags($_GET['mode']), 0, 20) : '';
if (!in_array($mode, $arr_mode)) if (!in_array($mode, $arr_mode))

View file

@ -16,7 +16,7 @@ include_once "./admin.head.php";
<?php <?php
$directory = []; $directory = [];
$dl = array('file', 'editor'); $dl = ['file', 'editor'];
foreach ($dl as $val) { foreach ($dl as $val) {
if ($handle = opendir(G5_DATA_PATH . '/' . $val)) { if ($handle = opendir(G5_DATA_PATH . '/' . $val)) {

View file

@ -72,7 +72,7 @@ $result = sql_query($sql);
$referer = iconv_utf8($referer); $referer = iconv_utf8($referer);
} }
$title = str_replace(array('<', '>', '&'), array("&lt;", "&gt;", "&amp;"), $referer); $title = str_replace(['<', '>', '&'], ["&lt;", "&gt;", "&amp;"], $referer);
$link = '<a href="' . get_text($row['vi_referer']) . '" target="_blank">'; $link = '<a href="' . get_text($row['vi_referer']) . '" target="_blank">';
$link = str_replace('&', "&amp;", $link); $link = str_replace('&', "&amp;", $link);
$link2 = '</a>'; $link2 = '</a>';

View file

@ -91,7 +91,7 @@ $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '">처음</a>'; //페이지
$referer = iconv('euc-kr', 'utf-8', $referer); $referer = iconv('euc-kr', 'utf-8', $referer);
} }
$title = str_replace(array("<", ">"), array("&lt;", "&gt;"), $referer); $title = str_replace(["<", ">"], ["&lt;", "&gt;"], $referer);
$link = '<a href="' . get_text($row['vi_referer']) . '" target="_blank" title="' . $title . '">'; $link = '<a href="' . get_text($row['vi_referer']) . '" target="_blank" title="' . $title . '">';
} }

View file

@ -7,7 +7,7 @@ $g5['title'] = '요일별 접속자집계';
include_once "./visit.sub.php"; include_once "./visit.sub.php";
$colspan = 4; $colspan = 4;
$weekday = array('월', '화', '수', '목', '금', '토', '일'); $weekday = ['월', '화', '수', '목', '금', '토', '일'];
$sum_count = 0; $sum_count = 0;
$sql = " select WEEKDAY(vs_date) as weekday_date, SUM(vs_count) as cnt $sql = " select WEEKDAY(vs_date) as weekday_date, SUM(vs_count) as cnt

View file

@ -28,18 +28,18 @@ $g5['title'] = '글,댓글 현황';
include_once "./admin.head.php"; include_once "./admin.head.php";
$period_array = array( $period_array = array(
'오늘' => array('시간', 0), '오늘' => ['시간', 0],
'어제' => array('시간', 0), '어제' => ['시간', 0],
'7일전' => array('일', 7), '7일전' => ['일', 7],
'14일전' => array('일', 14), '14일전' => ['일', 14],
'30일전' => array('일', 30), '30일전' => ['일', 30],
'3개월전' => array('주', 90), '3개월전' => ['주', 90],
'6개월전' => array('주', 180), '6개월전' => ['주', 180],
'1년전' => array('월', 365), '1년전' => ['월', 365],
'2년전' => array('월', 365 * 2), '2년전' => ['월', 365 * 2],
'3년전' => array('월', 365 * 3), '3년전' => ['월', 365 * 3],
'5년전' => array('년', 365 * 5), '5년전' => ['년', 365 * 5],
'10년전' => array('년', 365 * 10), '10년전' => ['년', 365 * 10],
); );
$is_period = false; $is_period = false;

View file

@ -10,4 +10,4 @@ $token = _token();
set_session($ss_name, $token); set_session($ss_name, $token);
die(json_encode(array('token' => $token))); die(json_encode(['token' => $token]));

View file

@ -214,7 +214,7 @@ $next_part_href = '';
if ($sca || $stx) { if ($sca || $stx) {
$list_href = './board.php?bo_table=' . $bo_table; $list_href = './board.php?bo_table=' . $bo_table;
$patterns = array('#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#'); $patterns = ['#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#'];
//if ($prev_spt >= $min_spt) //if ($prev_spt >= $min_spt)
$prev_spt = $spt - $config['cf_search_part']; $prev_spt = $spt - $config['cf_search_part'];

View file

@ -228,7 +228,7 @@ $next_part_href = '';
if ($sca || $stx) { if ($sca || $stx) {
$list_href = './board.php?bo_table=' . $bo_table; $list_href = './board.php?bo_table=' . $bo_table;
$patterns = array('#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#'); $patterns = ['#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#'];
//if ($prev_spt >= $min_spt) //if ($prev_spt >= $min_spt)
$prev_spt = $spt - $config['cf_search_part']; $prev_spt = $spt - $config['cf_search_part'];

View file

@ -8,7 +8,7 @@ function specialchars_replace($str, $len = 0)
$str = substr($str, 0, $len); $str = substr($str, 0, $len);
} }
$str = str_replace(array("&", "<", ">"), array("&amp;", "&lt;", "&gt;"), $str); $str = str_replace(["&", "<", ">"], ["&amp;", "&lt;", "&gt;"], $str);
/* /*
$str = preg_replace("/&/", "&amp;", $str); $str = preg_replace("/&/", "&amp;", $str);

View file

@ -209,7 +209,7 @@ if ($w == 'c') // 댓글 입력
$wr_content = nl2br(get_text(stripslashes("원글\n{$wr['wr_subject']}\n\n\n댓글\n$wr_content"))); $wr_content = nl2br(get_text(stripslashes("원글\n{$wr['wr_subject']}\n\n\n댓글\n$wr_content")));
$warr = array('' => '입력', 'u' => '수정', 'r' => '답변', 'c' => '댓글 ', 'cu' => '댓글 수정'); $warr = ['' => '입력', 'u' => '수정', 'r' => '답변', 'c' => '댓글 ', 'cu' => '댓글 수정'];
$str = $warr[$w]; $str = $warr[$w];
$subject = '[' . $config['cf_title'] . '] ' . $board['bo_subject'] . ' 게시판에 ' . $str . '글이 올라왔습니다.'; $subject = '[' . $config['cf_title'] . '] ' . $board['bo_subject'] . ' 게시판에 ' . $str . '글이 올라왔습니다.';

View file

@ -65,7 +65,7 @@ if ($_POST['twitter_checked']) {
$access_token = $_SESSION['access_token']; $access_token = $_SESSION['access_token'];
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']); $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
// 등록 // 등록
$connection->post('statuses/update', array('status' => $post)); $connection->post('statuses/update', ['status' => $post]);
set_cookie('ck_twitter_checked', true, 86400 * 31); set_cookie('ck_twitter_checked', true, 86400 * 31);
} }

View file

@ -3,10 +3,10 @@ include_once "./_common.php";
include_once G5_LIB_PATH . "/json.lib.php"; include_once G5_LIB_PATH . "/json.lib.php";
if (!$bo_table) if (!$bo_table)
die(json_encode(array('error' => '게시판 정보가 올바르지 않습니다.', 'url' => G5_URL))); die(json_encode(['error' => '게시판 정보가 올바르지 않습니다.', 'url' => G5_URL]));
set_session('ss_write_' . $bo_table . '_token', ''); set_session('ss_write_' . $bo_table . '_token', '');
$token = get_write_token($bo_table); $token = get_write_token($bo_table);
die(json_encode(array('error' => '', 'token' => $token, 'url' => ''))); die(json_encode(['error' => '', 'token' => $token, 'url' => '']));

View file

@ -699,7 +699,7 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
$wr_content = conv_content(conv_unescape_nl(stripslashes($wr_content)), $tmp_html); $wr_content = conv_content(conv_unescape_nl(stripslashes($wr_content)), $tmp_html);
$warr = array('' => '입력', 'u' => '수정', 'r' => '답변', 'c' => '코멘트', 'cu' => '코멘트 수정'); $warr = ['' => '입력', 'u' => '수정', 'r' => '답변', 'c' => '코멘트', 'cu' => '코멘트 수정'];
$str = $warr[$w]; $str = $warr[$w];
$subject = '[' . $config['cf_title'] . '] ' . $board['bo_subject'] . ' 게시판에 ' . $str . '글이 올라왔습니다.'; $subject = '[' . $config['cf_title'] . '] ' . $board['bo_subject'] . ' 게시판에 ' . $str . '글이 올라왔습니다.';

View file

@ -672,7 +672,7 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
$wr_content = conv_content(conv_unescape_nl(stripslashes($wr_content)), $tmp_html); $wr_content = conv_content(conv_unescape_nl(stripslashes($wr_content)), $tmp_html);
$warr = array('' => '입력', 'u' => '수정', 'r' => '답변', 'c' => '코멘트', 'cu' => '코멘트 수정'); $warr = ['' => '입력', 'u' => '수정', 'r' => '답변', 'c' => '코멘트', 'cu' => '코멘트 수정'];
$str = $warr[$w]; $str = $warr[$w];
$subject = '[' . $config['cf_title'] . '] ' . $board['bo_subject'] . ' 게시판에 ' . $str . '글이 올라왔습니다.'; $subject = '[' . $config['cf_title'] . '] ' . $board['bo_subject'] . ' 게시판에 ' . $str . '글이 올라왔습니다.';

View file

@ -2,7 +2,7 @@
if (!defined('_GNUBOARD_')) if (!defined('_GNUBOARD_'))
exit; exit;
$yoil = array("", "", "", "", "", "", ""); $yoil = ["", "", "", "", "", "", ""];
$is_add_register = $config['cf_1'] ? true : false; $is_add_register = $config['cf_1'] ? true : false;
function get_category_list($bo_table = '', $ca_name = '') function get_category_list($bo_table = '', $ca_name = '')
@ -282,9 +282,9 @@ function hex2rgba($color, $opacity = false)
$color = substr($color, 1); $color = substr($color, 1);
} }
if (strlen($color) == 6) { if (strlen($color) == 6) {
$hex = array($color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5]); $hex = [$color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5]];
} elseif (strlen($color) == 3) { } elseif (strlen($color) == 3) {
$hex = array($color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2]); $hex = [$color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2]];
} else { } else {
return $default; return $default;
} }

View file

@ -6,7 +6,7 @@ function get_status($ch_id, $st_id)
{ {
global $g5; global $g5;
$result = array(); $result = [];
$sc = sql_fetch("select sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$st_id}'"); $sc = sql_fetch("select sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$st_id}'");
$sl = sql_fetch("select st_id, st_use_max, st_max, st_min from {$g5['status_config_table']} where st_id = '{$st_id}'"); $sl = sql_fetch("select st_id, st_use_max, st_max, st_min from {$g5['status_config_table']} where st_id = '{$st_id}'");
@ -23,7 +23,7 @@ function get_status_by_name($ch_id, $st_name)
{ {
global $g5; global $g5;
$result = array(); $result = [];
$sl = sql_fetch("select st_id, st_use_max, st_max from {$g5['status_config_table']} where st_name = '{$st_name}'"); $sl = sql_fetch("select st_id, st_use_max, st_max from {$g5['status_config_table']} where st_name = '{$st_name}'");
$sc = sql_fetch("select sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$sl['st_id']}'"); $sc = sql_fetch("select sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$sl['st_id']}'");
@ -75,7 +75,7 @@ function set_status($ch_id, $st_id, $hunt, $msg = '')
{ {
global $g5; global $g5;
$result = array(); $result = [];
$sl = sql_fetch("select st_id from {$g5['status_config_table']} where st_id = '{$st_id}'"); $sl = sql_fetch("select st_id from {$g5['status_config_table']} where st_id = '{$st_id}'");
$sc = sql_fetch("select sc_id, sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$sl['st_id']}'"); $sc = sql_fetch("select sc_id, sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$sl['st_id']}'");
@ -99,7 +99,7 @@ function set_status_by_name($ch_id, $st_name, $hunt, $msg = '')
{ {
global $g5; global $g5;
$result = array(); $result = [];
$sl = sql_fetch("select st_id from {$g5['status_config_table']} where st_name = '{$st_name}'"); $sl = sql_fetch("select st_id from {$g5['status_config_table']} where st_name = '{$st_name}'");
$sc = sql_fetch("select sc_id, sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$sl['st_id']}'"); $sc = sql_fetch("select sc_id, sc_value, sc_max from {$g5['status_table']} where ch_id = '{$ch_id}' and st_id = '{$sl['st_id']}'");

View file

@ -19,9 +19,9 @@ class FileCache
* *
* @param array $options * @param array $options
*/ */
public function __construct($options = array()) public function __construct($options = [])
{ {
$available_options = array('_cache_path', 'file_extension'); $available_options = ['_cache_path', 'file_extension'];
foreach ($available_options as $name) { foreach ($available_options as $name) {
if (isset($options[$name])) { if (isset($options[$name])) {
$this->$name = $options[$name]; $this->$name = $options[$name];
@ -76,7 +76,7 @@ class FileCache
$file_ex = explode("\n\n", $file_contents); $file_ex = explode("\n\n", $file_contents);
$data = unserialize(base64_decode($file_ex[1])); $data = unserialize(base64_decode($file_ex[1]));
} catch (Exception $e) { } catch (Exception $e) {
$data = array('ttl' => 1, 'time' => $server_time - 1000); $data = ['ttl' => 1, 'time' => $server_time - 1000];
} }
if ($data['ttl'] > 0 && $server_time > $data['time'] + $data['ttl']) { if ($data['ttl'] > 0 && $server_time > $data['time'] + $data['ttl']) {
@ -179,7 +179,7 @@ class FileCache
if ($ttl !== null) { if ($ttl !== null) {
$expire = time() + $ttl; $expire = time() + $ttl;
} }
return base64_encode(serialize(array($data, $expire))); return base64_encode(serialize([$data, $expire]));
} }
/** /**

View file

@ -4,9 +4,9 @@ if (!defined('_GNUBOARD_'))
class G5_object_cache class G5_object_cache
{ {
public $writes = array(); public $writes = [];
public $contents = array(); public $contents = [];
public $etcs = array(); public $etcs = [];
function get($type, $key, $group = 'default') function get($type, $key, $group = 'default')
{ {
@ -53,7 +53,7 @@ class G5_object_cache
return isset($datas[$group]) && (isset($datas[$group][$key]) || array_key_exists($key, $datas[$group])); return isset($datas[$group]) && (isset($datas[$group][$key]) || array_key_exists($key, $datas[$group]));
} }
function set($type, $key, $data = array(), $group = 'default') function set($type, $key, $data = [], $group = 'default')
{ {
if (is_object($data)) if (is_object($data))
$data = clone $data; $data = clone $data;

View file

@ -35,7 +35,7 @@ class Hook
* *
* @var array * @var array
*/ */
protected $callbacks = array(); protected $callbacks = [];
/** /**
* Number of actions executed. * Number of actions executed.
@ -44,7 +44,7 @@ class Hook
* *
* @var array * @var array
*/ */
protected $actions = array('count' => 0); protected $actions = ['count' => 0];
/** /**
* Current action hook. * Current action hook.
@ -71,7 +71,7 @@ class Hook
* *
* @var array * @var array
*/ */
private static $instances = array(); private static $instances = [];
/** /**
* Get instance. * Get instance.
@ -143,7 +143,7 @@ class Hook
public static function addActions($actions) public static function addActions($actions)
{ {
foreach ($actions as $arguments) { foreach ($actions as $arguments) {
call_user_func_array(array(__CLASS__, 'addAction'), $arguments); call_user_func_array([__CLASS__, 'addAction'], $arguments);
} }
return true; return true;
@ -166,7 +166,7 @@ class Hook
* *
* @return mixed returns the output of the last action or false * @return mixed returns the output of the last action or false
*/ */
public static function doAction($tag, $args = array(), $remove = true) public static function doAction($tag, $args = [], $remove = true)
{ {
$that = self::getInstance(self::$id); $that = self::getInstance(self::$id);
@ -259,14 +259,14 @@ class Hook
if (!($class && $method) && function_exists($function)) { if (!($class && $method) && function_exists($function)) {
return call_user_func($function, $args); return call_user_func($function, $args);
} elseif ($obj = call_user_func(array($class, $this->singleton))) { } elseif ($obj = call_user_func([$class, $this->singleton])) {
if ($obj !== false) { if ($obj !== false) {
return call_user_func_array(array($obj, $method), $args); return call_user_func_array([$obj, $method], $args);
} }
} elseif (class_exists($class)) { } elseif (class_exists($class)) {
$instance = new $class; $instance = new $class;
return call_user_func_array(array($instance, $method), $args); return call_user_func_array([$instance, $method], $args);
} }
return null; return null;
@ -291,7 +291,7 @@ class Hook
} }
} }
return isset($actions) ? $actions : array(); return isset($actions) ? $actions : [];
} }
/** /**
@ -307,7 +307,7 @@ class Hook
protected function getArguments($argsNumber, $arguments) protected function getArguments($argsNumber, $arguments)
{ {
if ($argsNumber == 1 && is_string($arguments)) { if ($argsNumber == 1 && is_string($arguments)) {
return array($arguments); return [$arguments];
} elseif ($argsNumber === count($arguments)) { } elseif ($argsNumber === count($arguments)) {
return $arguments; return $arguments;
} }
@ -321,6 +321,6 @@ class Hook
return $args; return $args;
} }
return array(); return [];
} }
} }

View file

@ -5,9 +5,9 @@ if (!defined('_GNUBOARD_'))
class GML_Hook extends Hook class GML_Hook extends Hook
{ {
protected $filters = array('count' => 0); protected $filters = ['count' => 0];
protected $callback_filters = array(); protected $callback_filters = [];
protected static $current_filter = false; protected static $current_filter = false;
@ -23,14 +23,14 @@ class GML_Hook extends Hook
if (!($class && $method) && is_callable($function)) { if (!($class && $method) && is_callable($function)) {
return call_user_func_array($function, $args); return call_user_func_array($function, $args);
} elseif ($obj = call_user_func(array($class, $this->singleton))) { } elseif ($obj = call_user_func([$class, $this->singleton])) {
if ($obj !== false) { if ($obj !== false) {
return call_user_func_array(array($obj, $method), $args); return call_user_func_array([$obj, $method], $args);
} }
} elseif (class_exists($class)) { } elseif (class_exists($class)) {
$instance = new $class; $instance = new $class;
return call_user_func_array(array($instance, $method), $args); return call_user_func_array([$instance, $method], $args);
} }
} }
@ -43,7 +43,7 @@ class GML_Hook extends Hook
} }
} }
return (isset($filters)) ? $filters : array(); return (isset($filters)) ? $filters : [];
} }
public static function get_properties($type, $is_callback = false) public static function get_properties($type, $is_callback = false)
@ -70,7 +70,7 @@ class GML_Hook extends Hook
return true; return true;
} }
public static function apply_filters($tag, $args = array(), $remove = true) public static function apply_filters($tag, $args = [], $remove = true)
{ {
$that = self::getInstance(self::$id); $that = self::getInstance(self::$id);
@ -109,12 +109,12 @@ class GML_Hook extends Hook
protected function getArguments($argsNumber, $arguments) protected function getArguments($argsNumber, $arguments)
{ {
if ($argsNumber == 1 && is_string($arguments)) { if ($argsNumber == 1 && is_string($arguments)) {
return array($arguments); return [$arguments];
} elseif ($argsNumber === count($arguments)) { } elseif ($argsNumber === count($arguments)) {
return $arguments; return $arguments;
} }
$args = array(); $args = [];
for ($i = 0; $i < $argsNumber; $i++) { for ($i = 0; $i < $argsNumber; $i++) {
if (is_array($arguments) && array_key_exists($i, $arguments)) { if (is_array($arguments) && array_key_exists($i, $arguments)) {

View file

@ -246,12 +246,12 @@ function url_auto_link($str)
// 140326 유창화님 제안코드로 수정 // 140326 유창화님 제안코드로 수정
// http://sir.kr/pg_lecture/461 // http://sir.kr/pg_lecture/461
// http://sir.kr/pg_lecture/463 // http://sir.kr/pg_lecture/463
$str = str_replace(array("&lt;", "&gt;", "&amp;", "&quot;", "&nbsp;", "&#039;"), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t", "'"), $str); $str = str_replace(["&lt;", "&gt;", "&amp;", "&quot;", "&nbsp;", "&#039;"], ["\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t", "'"], $str);
//$str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "<A HREF=\"\\1\" TARGET='{$config['cf_link_target']}'>\\1</A>", $str); //$str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "<A HREF=\"\\1\" TARGET='{$config['cf_link_target']}'>\\1</A>", $str);
$str = preg_replace("/([^(href=\"?'?)|(src=\"?'?)]|\(|^)((http|https|ftp|telnet|news|mms):\/\/[a-zA-Z0-9\.-]+\.[가-힣\xA1-\xFEa-zA-Z0-9\.:&#=_\?\/~\+%@;\-\|\,\(\)]+)/i", "\\1<A HREF=\"\\2\" TARGET=\"{$config['cf_link_target']}\">\\2</A>", $str); $str = preg_replace("/([^(href=\"?'?)|(src=\"?'?)]|\(|^)((http|https|ftp|telnet|news|mms):\/\/[a-zA-Z0-9\.-]+\.[가-힣\xA1-\xFEa-zA-Z0-9\.:&#=_\?\/~\+%@;\-\|\,\(\)]+)/i", "\\1<A HREF=\"\\2\" TARGET=\"{$config['cf_link_target']}\">\\2</A>", $str);
$str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1<A HREF=\"http://\\2\" TARGET=\"{$config['cf_link_target']}\">\\2</A>", $str); $str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1<A HREF=\"http://\\2\" TARGET=\"{$config['cf_link_target']}\">\\2</A>", $str);
$str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "<a href=\"mailto:\\0\">\\0</a>", $str); $str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "<a href=\"mailto:\\0\">\\0</a>", $str);
$str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t", "'"), array("&nbsp;", "&lt;", "&gt;", "&#039;"), $str); $str = str_replace(["\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t", "'"], ["&nbsp;", "&lt;", "&gt;", "&#039;"], $str);
/* /*
// 속도 향상 031011 // 속도 향상 031011
@ -483,8 +483,8 @@ function search_font($stx, $str)
global $config; global $config;
// 문자앞에 \ 를 붙입니다. // 문자앞에 \ 를 붙입니다.
$src = array('/', '|'); $src = ['/', '|'];
$dst = array('\/', '\|'); $dst = ['\/', '\|'];
if (!trim($stx)) if (!trim($stx))
return $str; return $str;
@ -1475,7 +1475,7 @@ function get_text($str, $html = 0, $restore = false)
// HTML 특수문자 변환 htmlspecialchars // HTML 특수문자 변환 htmlspecialchars
function hsc($str) function hsc($str)
{ {
$trans = array("\"" => "&#034;", "'" => "&#039;", "<"=>"&#060;", ">"=>"&#062;"); $trans = ["\"" => "&#034;", "'" => "&#039;", "<"=>"&#060;", ">"=>"&#062;"];
$str = strtr($str, $trans); $str = strtr($str, $trans);
return $str; return $str;
} }
@ -1826,7 +1826,7 @@ function referer_check($url = '')
// 한글 요일 // 한글 요일
function get_yoil($date, $full = 0) function get_yoil($date, $full = 0)
{ {
$arr_yoil = array('일', '월', '화', '수', '목', '금', '토'); $arr_yoil = ['일', '월', '화', '수', '목', '금', '토'];
$yoil = date("w", strtotime($date)); $yoil = date("w", strtotime($date));
$str = $arr_yoil[$yoil]; $str = $arr_yoil[$yoil];
@ -2571,7 +2571,7 @@ function board_notice($bo_notice, $wr_id, $insert = false)
if ($insert && in_array($wr_id, $notice_array)) if ($insert && in_array($wr_id, $notice_array))
return $bo_notice; return $bo_notice;
$notice_array = array_merge(array($wr_id), $notice_array); $notice_array = array_merge([$wr_id], $notice_array);
$notice_array = array_unique($notice_array); $notice_array = array_unique($notice_array);
foreach ($notice_array as $key => $value) { foreach ($notice_array as $key => $value) {
if (!trim($value)) if (!trim($value))
@ -2596,7 +2596,7 @@ function googl_short_url($longUrl)
// URL Shortener API ON // URL Shortener API ON
$apiKey = $config['cf_googl_shorturl_apikey']; $apiKey = $config['cf_googl_shorturl_apikey'];
$postData = array('longUrl' => $longUrl); $postData = ['longUrl' => $longUrl];
$jsonData = json_encode($postData); $jsonData = json_encode($postData);
$curlObj = curl_init(); $curlObj = curl_init();
@ -2605,7 +2605,7 @@ function googl_short_url($longUrl)
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0);
curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json')); curl_setopt($curlObj, CURLOPT_HTTPHEADER, ['Content-type:application/json']);
curl_setopt($curlObj, CURLOPT_POST, 1); curl_setopt($curlObj, CURLOPT_POST, 1);
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $jsonData); curl_setopt($curlObj, CURLOPT_POSTFIELDS, $jsonData);
@ -2846,7 +2846,7 @@ function check_input_vars()
// HTML 특수문자 변환 htmlspecialchars // HTML 특수문자 변환 htmlspecialchars
function htmlspecialchars2($str) function htmlspecialchars2($str)
{ {
$trans = array("\"" => "&#034;", "'" => "&#039;", "<" => "&#060;", ">" => "&#062;"); $trans = ["\"" => "&#034;", "'" => "&#039;", "<" => "&#060;", ">" => "&#062;"];
$str = strtr($str, $trans); $str = strtr($str, $trans);
return $str; return $str;
} }
@ -2906,7 +2906,7 @@ function clean_xss_tags($str, $check_entities = 0, $is_remove_tags = 0, $cur_str
$result = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $str); $result = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $str);
if ($check_entities) { if ($check_entities) {
$result = str_replace(array('&colon;', '&lpar;', '&rpar;', '&NewLine;', '&Tab;'), '', $result); $result = str_replace(['&colon;', '&lpar;', '&rpar;', '&NewLine;', '&Tab;'], '', $result);
} }
$result = preg_replace( $result = preg_replace(
@ -2977,8 +2977,8 @@ function clean_relative_paths($path)
// unescape nl 얻기 // unescape nl 얻기
function conv_unescape_nl($str) function conv_unescape_nl($str)
{ {
$search = array('\\r', '\r', '\\n', '\n'); $search = ['\\r', '\r', '\\n', '\n'];
$replace = array('', '', "\n", "\n"); $replace = ['', '', "\n", "\n"];
return str_replace($search, $replace, $str); return str_replace($search, $replace, $str);
} }
@ -3484,7 +3484,7 @@ function is_include_path_check($path = '', $is_input = '')
} }
// resolve path parts (single dot, double dot and double delimiters) // resolve path parts (single dot, double dot and double delimiters)
$path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path); $path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
$absolutes = []; $absolutes = [];
foreach ($parts as $part) { foreach ($parts as $part) {

View file

@ -20,7 +20,7 @@ if (!function_exists('json_encode')) {
return floatval(str_replace(',', '.', strval($a))); return floatval(str_replace(',', '.', strval($a)));
} }
if (is_string($a)) { if (is_string($a)) {
static $jsonReplaces = array(array('\\', '/', "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')); static $jsonReplaces = [['\\', '/', "\n", "\t", "\r", "\b", "\f", '"'], ['\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"']];
return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"'; return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
} else } else
return $a; return $a;
@ -32,7 +32,7 @@ if (!function_exists('json_encode')) {
break; break;
} }
} }
$result = array(); $result = [];
if ($isList) { if ($isList) {
foreach ($a as $v) foreach ($a as $v)
$result[] = json_encode($v); $result[] = json_encode($v);

View file

@ -36,7 +36,7 @@ function latest($skin_dir = '', $bo_table, $rows = 10, $subject_len = 40, $cache
} }
if (!G5_USE_CACHE || $cache_fwrite) { if (!G5_USE_CACHE || $cache_fwrite) {
$list = array(); $list = [];
$sql = "SELECT * FROM {$g5['board_table']} where bo_table = '{$bo_table}' "; $sql = "SELECT * FROM {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql); $board = sql_fetch($sql);

View file

@ -70,6 +70,6 @@ function attach_file($filename, $tmp_name)
// 서버에 업로드 되는 파일은 확장자를 주지 않는다. (보안 취약점) // 서버에 업로드 되는 파일은 확장자를 주지 않는다. (보안 취약점)
$dest_file = G5_DATA_PATH . '/tmp/' . str_replace('/', '_', $tmp_name); $dest_file = G5_DATA_PATH . '/tmp/' . str_replace('/', '_', $tmp_name);
move_uploaded_file($tmp_name, $dest_file); move_uploaded_file($tmp_name, $dest_file);
$tmpfile = array("name" => $filename, "path" => $dest_file); $tmpfile = ["name" => $filename, "path" => $dest_file];
return $tmpfile; return $tmpfile;
} }

View file

@ -44,7 +44,7 @@ function naver_syndi_ping($bo_table, $wr_id)
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 10, CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => array("Host: apis.naver.com", "Pragma: no-cache", "Accept: */*", $ping_auth_header) CURLOPT_HTTPHEADER => ["Host: apis.naver.com", "Pragma: no-cache", "Accept: */*", $ping_auth_header]
); );
//print_r2($ping_client_opt); exit; //print_r2($ping_client_opt); exit;

View file

@ -11,7 +11,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$filename = $alt = $data_path = ''; $filename = $alt = $data_path = '';
$edt = false; $edt = false;
$empty_array = array('src' => '', 'ori' => '', 'alt' => ''); $empty_array = ['src' => '', 'ori' => '', 'alt' => ''];
$write = get_thumbnail_find_cache($bo_table, $wr_id, 'content'); $write = get_thumbnail_find_cache($bo_table, $wr_id, 'content');
@ -62,7 +62,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
if (!$filename) if (!$filename)
return $empty_array; return $empty_array;
if ($thumbnail_info = run_replace('get_list_thumbnail_info', array(), array('bo_table' => $bo_table, 'wr_id' => $wr_id, 'data_path' => $data_path, 'edt' => $edt, 'filename' => $filename, 'filepath' => $filepath, 'thumb_width' => $thumb_width, 'thumb_height' => $thumb_height, 'is_create' => $is_create, 'is_crop' => $is_crop, 'crop_mode' => $crop_mode, 'is_sharpen' => $is_sharpen, 'um_value' => $um_value))) { if ($thumbnail_info = run_replace('get_list_thumbnail_info', [], ['bo_table' => $bo_table, 'wr_id' => $wr_id, 'data_path' => $data_path, 'edt' => $edt, 'filename' => $filename, 'filepath' => $filepath, 'thumb_width' => $thumb_width, 'thumb_height' => $thumb_height, 'is_create' => $is_create, 'is_crop' => $is_crop, 'crop_mode' => $crop_mode, 'is_sharpen' => $is_sharpen, 'um_value' => $um_value])) {
return $thumbnail_info; return $thumbnail_info;
} }
@ -82,7 +82,7 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
return $empty_array; return $empty_array;
} }
$thumb = array("src" => $src, "ori" => $ori, "alt" => $alt); $thumb = ["src" => $src, "ori" => $ori, "alt" => $alt];
return $thumb; return $thumb;
} }
@ -117,7 +117,7 @@ function get_view_thumbnail($contents, $thumb_width = 0)
if (empty($matches)) if (empty($matches))
return $contents; return $contents;
$extensions = array(1 => 'gif', 2 => 'jpg', 3 => 'png', 18 => 'webp'); $extensions = [1 => 'gif', 2 => 'jpg', 3 => 'png', 18 => 'webp'];
for ($i = 0; $i < count($matches[1]); $i++) { for ($i = 0; $i < count($matches[1]); $i++) {
@ -244,7 +244,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$size = @getimagesize($source_file); $size = @getimagesize($source_file);
$extensions = array(1 => 'gif', 2 => 'jpg', 3 => 'png', 18 => 'webp'); $extensions = [1 => 'gif', 2 => 'jpg', 3 => 'png', 18 => 'webp'];
$file_ext = $extensions[$size[2]]; // 파일 확장자 $file_ext = $extensions[$size[2]]; // 파일 확장자
if (!$file_ext) if (!$file_ext)
return; return;
@ -638,9 +638,9 @@ function UnsharpMask($img, $amount, $radius, $threshold)
if (function_exists('imageconvolution')) { // PHP >= 5.1 if (function_exists('imageconvolution')) { // PHP >= 5.1
$matrix = array( $matrix = array(
array(1, 2, 1), [1, 2, 1],
array(2, 4, 2), [2, 4, 2],
array(1, 2, 1) [1, 2, 1]
); );
$divisor = array_sum(array_map('array_sum', $matrix)); $divisor = array_sum(array_map('array_sum', $matrix));
$offset = 0; $offset = 0;
@ -762,7 +762,7 @@ function is_animated_webp($filename)
function is_animated_gif($filename) function is_animated_gif($filename)
{ {
static $cache = array(); static $cache = [];
$key = md5($filename); $key = md5($filename);
if (isset($cache[$key])) { if (isset($cache[$key])) {

View file

@ -8,7 +8,7 @@ function get_pretty_url($folder, $no = '', $query_string = '', $action = '')
global $g5, $config; global $g5, $config;
$boards = get_board_names(); $boards = get_board_names();
$segments = array(); $segments = [];
$url = $add_query = ''; $url = $add_query = '';
if ($url = run_replace('get_pretty_url', $url, $folder, $no, $query_string, $action)) { if ($url = run_replace('get_pretty_url', $url, $folder, $no, $query_string, $action)) {
@ -111,7 +111,7 @@ function short_url_clean($string_url, $add_qry = '')
$url = parse_url($string_url); $url = parse_url($string_url);
$page_name = isset($url['path']) ? basename($url['path'], ".php") : ''; $page_name = isset($url['path']) ? basename($url['path'], ".php") : '';
$array_page_names = run_replace('url_clean_page_names', array('board', 'write', 'content')); $array_page_names = run_replace('url_clean_page_names', ['board', 'write', 'content']);
if (stripos(preg_replace('/^https?:/i', '', $string_url), preg_replace('/^https?:/i', '', G5_BBS_URL)) === false || !in_array($page_name, $array_page_names)) { //게시판이 아니면 리턴 if (stripos(preg_replace('/^https?:/i', '', $string_url), preg_replace('/^https?:/i', '', G5_BBS_URL)) === false || !in_array($page_name, $array_page_names)) { //게시판이 아니면 리턴
return run_replace('false_short_url_clean', $string_url, $url, $page_name, $array_page_names); return run_replace('false_short_url_clean', $string_url, $url, $page_name, $array_page_names);
@ -127,15 +127,15 @@ function short_url_clean($string_url, $add_qry = '')
if ($page_name === 'write') { if ($page_name === 'write') {
$vars['action'] = 'write'; $vars['action'] = 'write';
$allow_param_keys = array('bo_table' => '', 'action' => ''); $allow_param_keys = ['bo_table' => '', 'action' => ''];
} else if ($page_name === 'content') { } else if ($page_name === 'content') {
$vars['action'] = 'content'; $vars['action'] = 'content';
$allow_param_keys = array('action' => '', 'co_id' => ''); $allow_param_keys = ['action' => '', 'co_id' => ''];
} else { } else {
$allow_param_keys = array('bo_table' => '', 'wr_id' => ''); $allow_param_keys = ['bo_table' => '', 'wr_id' => ''];
} }
$s = array(); $s = [];
foreach ($allow_param_keys as $key => $v) { foreach ($allow_param_keys as $key => $v) {
if (!isset($vars[$key]) || empty($vars[$key])) if (!isset($vars[$key]) || empty($vars[$key]))
@ -159,7 +159,7 @@ function short_url_clean($string_url, $add_qry = '')
if (isset($url['host'])) { if (isset($url['host'])) {
$array_file_paths = run_replace('url_clean_page_paths', array('/' . G5_BBS_DIR . '/board.php', '/' . G5_BBS_DIR . '/write.php', '/' . G5_BBS_DIR . '/content.php')); $array_file_paths = run_replace('url_clean_page_paths', ['/' . G5_BBS_DIR . '/board.php', '/' . G5_BBS_DIR . '/write.php', '/' . G5_BBS_DIR . '/content.php']);
$str_path = isset($url['path']) ? $url['path'] : ''; $str_path = isset($url['path']) ? $url['path'] : '';
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'; $http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
@ -354,7 +354,7 @@ function get_nginx_conf_rules($return_string = false)
$get_path_url = parse_url(G5_URL); $get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/'; $base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/';
$rules = array(); $rules = [];
$rules[] = '#### ' . G5_VERSION . ' nginx rules BEGIN #####'; $rules[] = '#### ' . G5_VERSION . ' nginx rules BEGIN #####';
if ($add_rules = run_replace('add_nginx_conf_pre_rules', '', $get_path_url, $base_path, $return_string)) { if ($add_rules = run_replace('add_nginx_conf_pre_rules', '', $get_path_url, $base_path, $return_string)) {
@ -385,7 +385,7 @@ function get_mod_rewrite_rules($return_string = false)
$get_path_url = parse_url(G5_URL); $get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/'; $base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/';
$rules = array(); $rules = [];
$rules[] = '#### ' . G5_VERSION . ' rewrite BEGIN #####'; $rules[] = '#### ' . G5_VERSION . ' rewrite BEGIN #####';
$rules[] = '<IfModule mod_rewrite.c>'; $rules[] = '<IfModule mod_rewrite.c>';
$rules[] = 'RewriteEngine On'; $rules[] = 'RewriteEngine On';

View file

@ -14,20 +14,20 @@
class UploadHandler class UploadHandler
{ {
public $files = array(); public $files = [];
protected $options; protected $options;
protected $post_max_size; protected $post_max_size;
protected $error_messages; protected $error_messages;
protected $image_objects = array(); protected $image_objects = [];
private static $MIME_TYPES_PROCESSORS = array( private static $MIME_TYPES_PROCESSORS = array(
"image/gif" => array("imagecreatefromgif", "imagegif"), "image/gif" => ["imagecreatefromgif", "imagegif"],
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpg" => ["imagecreatefromjpeg", "imagejpeg"],
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpeg" => ["imagecreatefromjpeg", "imagejpeg"],
"image/png" => array("imagecreatefrompng", "imagepng"), "image/png" => ["imagecreatefrompng", "imagepng"],
"image/webp" => array("imagecreatefromwebp", "imagewebp"), "image/webp" => ["imagecreatefromwebp", "imagewebp"],
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp") "image/bmp" => ["imagecreatefromwbmp", "imagewbmp"]
); );
public function __construct($options = null, $initialize = true, $error_messages = null) public function __construct($options = null, $initialize = true, $error_messages = null)
@ -363,10 +363,10 @@ class UploadHandler
{ {
$upload_dir = $this->get_upload_path(); $upload_dir = $this->get_upload_path();
if (!is_dir($upload_dir)) { if (!is_dir($upload_dir)) {
return array(); return [];
} }
return array_values(array_filter(array_map( return array_values(array_filter(array_map(
array($this, $iteration_method), [$this, $iteration_method],
scandir($upload_dir) scandir($upload_dir)
))); )));
} }
@ -491,7 +491,7 @@ class UploadHandler
{ {
return preg_replace_callback( return preg_replace_callback(
'/(?:(?: \(([\d]+)\))?(\.[^.]+))?$/', '/(?:(?: \(([\d]+)\))?(\.[^.]+))?$/',
array($this, 'upcount_name_callback'), [$this, 'upcount_name_callback'],
$name, $name,
1 1
); );
@ -539,16 +539,16 @@ class UploadHandler
if (function_exists('exif_imagetype') && $file_path) { if (function_exists('exif_imagetype') && $file_path) {
switch (@exif_imagetype($file_path)) { switch (@exif_imagetype($file_path)) {
case IMAGETYPE_JPEG: case IMAGETYPE_JPEG:
$extensions = array('jpg', 'jpeg'); $extensions = ['jpg', 'jpeg'];
break; break;
case IMAGETYPE_PNG: case IMAGETYPE_PNG:
$extensions = array('png'); $extensions = ['png'];
break; break;
case IMAGETYPE_GIF: case IMAGETYPE_GIF:
$extensions = array('gif'); $extensions = ['gif'];
break; break;
case IMAGETYPE_WEBP: case IMAGETYPE_WEBP:
$extensions = array('webp'); $extensions = ['webp'];
break; break;
} }
// Adjust incorrect image file extensions: // Adjust incorrect image file extensions:
@ -595,7 +595,7 @@ class UploadHandler
} else { } else {
$new_file_path = $file_path; $new_file_path = $file_path;
} }
return array($file_path, $new_file_path); return [$file_path, $new_file_path];
} }
protected function gd_get_image_object($file_path, $func, $no_cache = false) protected function gd_get_image_object($file_path, $func, $no_cache = false)
@ -1035,7 +1035,7 @@ class UploadHandler
$image = new \Imagick(); $image = new \Imagick();
try { try {
if (@$image->pingImage($file_path)) { if (@$image->pingImage($file_path)) {
$dimensions = array($image->getImageWidth(), $image->getImageHeight()); $dimensions = [$image->getImageWidth(), $image->getImageHeight()];
$image->destroy(); $image->destroy();
return $dimensions; return $dimensions;
} }
@ -1096,7 +1096,7 @@ class UploadHandler
protected function handle_image_file($file_path, $file) protected function handle_image_file($file_path, $file)
{ {
$failed_versions = array(); $failed_versions = [];
foreach ($this->options['image_versions'] as $version => $options) { foreach ($this->options['image_versions'] as $version => $options) {
if ($this->create_scaled_image($file->name, $version, $options)) { if ($this->create_scaled_image($file->name, $version, $options)) {
if (!empty($version)) { if (!empty($version)) {
@ -1356,7 +1356,7 @@ class UploadHandler
protected function get_file_names_params() protected function get_file_names_params()
{ {
$params = isset($_GET[$this->options['param_name']]) ? $params = isset($_GET[$this->options['param_name']]) ?
$_GET[$this->options['param_name']] : array(); $_GET[$this->options['param_name']] : [];
foreach ($params as $key => $value) { foreach ($params as $key => $value) {
$params[$key] = basename(stripslashes($value)); $params[$key] = basename(stripslashes($value));
} }
@ -1497,7 +1497,7 @@ class UploadHandler
$content_range = $this->get_server_var('HTTP_CONTENT_RANGE') ? $content_range = $this->get_server_var('HTTP_CONTENT_RANGE') ?
preg_split('/[^0-9]+/', $this->get_server_var('HTTP_CONTENT_RANGE')) : null; preg_split('/[^0-9]+/', $this->get_server_var('HTTP_CONTENT_RANGE')) : null;
$size = $content_range ? $content_range[3] : null; $size = $content_range ? $content_range[3] : null;
$files = array(); $files = [];
if ($upload && is_array($upload['tmp_name'])) { if ($upload && is_array($upload['tmp_name'])) {
// param_name is an array identifier like "files[]", // param_name is an array identifier like "files[]",
// $_FILES is a multi-dimensional array: // $_FILES is a multi-dimensional array:
@ -1529,7 +1529,7 @@ class UploadHandler
); );
} }
return $this->generate_response( return $this->generate_response(
array($this->options['param_name'] => $files), [$this->options['param_name'] => $files],
$print_response $print_response
); );
} }
@ -1539,9 +1539,9 @@ class UploadHandler
/* 보안 이슈 url을 참고 https://github.com/blueimp/jQuery-File-Upload/issues/2426 */ /* 보안 이슈 url을 참고 https://github.com/blueimp/jQuery-File-Upload/issues/2426 */
$file_names = $this->get_file_names_params(); $file_names = $this->get_file_names_params();
if (empty($file_names)) { if (empty($file_names)) {
$file_names = array($this->get_file_name_param()); $file_names = [$this->get_file_name_param()];
} }
$response = array(); $response = [];
foreach ($file_names as $file_name) { foreach ($file_names as $file_name) {
if (substr($file_name, 0, 32) != $this->get_file_passname()) if (substr($file_name, 0, 32) != $this->get_file_passname())
continue; //session_id() 와 비교하여 틀리면 지우지 않음 continue; //session_id() 와 비교하여 틀리면 지우지 않음

View file

@ -23,9 +23,9 @@ if (!class_exists('HTMLPurifier_Filter_Iframevideo')) {
public function preFilter($html, $config, $context) public function preFilter($html, $config, $context)
{ {
if (strstr($html, '<iframe')) { if (strstr($html, '<iframe')) {
$html = preg_replace_callback('/<iframe.*?src="https?:\/\/www\.youtube\.com\/embed\/([^"]*)[^>]*>(.*?)?\/iframe>/i', array($this, 'trust_url_match'), $html); $html = preg_replace_callback('/<iframe.*?src="https?:\/\/www\.youtube\.com\/embed\/([^"]*)[^>]*>(.*?)?\/iframe>/i', [$this, 'trust_url_match'], $html);
$html = preg_replace_callback('/<iframe.*?src="https?:\/\/player\.vimeo.com\/video\/([^"]*)[^>]*>(.*?)?\/iframe>/i', array($this, 'trust_url_match'), $html); $html = preg_replace_callback('/<iframe.*?src="https?:\/\/player\.vimeo.com\/video\/([^"]*)[^>]*>(.*?)?\/iframe>/i', [$this, 'trust_url_match'], $html);
$html = preg_replace_callback('/<iframe.*?src="https?:\/\/www\.facebook.com\/plugins\/([^"]*)[^>]*>(.*?)?\/iframe>/i', array($this, 'trust_url_match'), $html); $html = preg_replace_callback('/<iframe.*?src="https?:\/\/www\.facebook.com\/plugins\/([^"]*)[^>]*>(.*?)?\/iframe>/i', [$this, 'trust_url_match'], $html);
//$html = preg_replace('#<iframe#i', '<img class="Iframevideo"', $html); //$html = preg_replace('#<iframe#i', '<img class="Iframevideo"', $html);
//$html = preg_replace('#</iframe>#i', '</img>', $html); //$html = preg_replace('#</iframe>#i', '</img>', $html);
} }
@ -51,7 +51,7 @@ if (!class_exists('HTMLPurifier_Filter_Iframevideo')) {
public function postFilter($html, $config, $context) public function postFilter($html, $config, $context)
{ {
$post_regex = '#<img class="Iframevideo"([^>]+?)>#'; $post_regex = '#<img class="Iframevideo"([^>]+?)>#';
return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); return preg_replace_callback($post_regex, [$this, 'postFilterCallback'], $html);
} }
/** /**

View file

@ -44,7 +44,7 @@ $bo_v_sns_class = $config['cf_kakao_js_apikey'] ? 'show_kakao' : '';
Kakao.Link.sendDefault({ Kakao.Link.sendDefault({
objectType: 'feed', objectType: 'feed',
content: { content: {
title: "<?php echo str_replace(array('%27', '&#034;' , '\"'), '', strip_tags($view['subject'])); ?>", title: "<?php echo str_replace(['%27', '&#034;' , '\"'], '', strip_tags($view['subject'])); ?>",
description: "<?php echo preg_replace('/\r\n|\r|\n/','', strip_tags(get_text(cut_str(strip_tags($view['wr_content']), 200), 1))); ?>", description: "<?php echo preg_replace('/\r\n|\r|\n/','', strip_tags(get_text(cut_str(strip_tags($view['wr_content']), 200), 1))); ?>",
imageUrl: imageUrl, imageUrl: imageUrl,
link: { link: {

View file

@ -209,7 +209,7 @@ $next_part_href = '';
if ($sca || $stx) { if ($sca || $stx) {
$list_href = './board.php?bo_table=' . $bo_table; $list_href = './board.php?bo_table=' . $bo_table;
$patterns = array('#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#'); $patterns = ['#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#'];
//if ($prev_spt >= $min_spt) //if ($prev_spt >= $min_spt)
$prev_spt = $spt - $config['cf_search_part']; $prev_spt = $spt - $config['cf_search_part'];

View file

@ -26,7 +26,7 @@ $file_index = $board_skin_path . "/day"; ### 기념일 폴더 위치 지정
### 양력 기념일 파일 지정 : 해당년도 파일이 없으면 기본파일(solar.txt)을 불러온다 ### 양력 기념일 파일 지정 : 해당년도 파일이 없으면 기본파일(solar.txt)을 불러온다
//$dayfile = file($file_index."/solar.txt"); //$dayfile = file($file_index."/solar.txt");
$lastday = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $lastday = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
if ($year % 4 == 0) if ($year % 4 == 0)
$lastday[2] = 29; $lastday[2] = 29;
$dayoftheweek = date("w", mktime(0, 0, 0, $month, 1, $year)); $dayoftheweek = date("w", mktime(0, 0, 0, $month, 1, $year));