Compare commits

...
63 Commits
Author SHA1 Message Date
kagla c7de15f7f5 버전 5.4.14 수정 2021-08-10 11:28:17 +09:00
kagla 4595fefe7d 주석 오타 수정 (작은앙심님,210808) 2021-08-09 07:20:13 +00:00
kagla e3bfefab55 PHP8에서 Warning: Undefined variable $extensions 오류 나오지 않도록 수정 (다온테마님,210806) 2021-08-09 07:15:28 +00:00
kagla c024c7552b 게시글 입력시에도 $wr_1 ~ $wr_10 변수 사용시 오류 나오지 않도록 가변변수 생성 (다온테마님,210806) 2021-08-09 07:13:44 +00:00
kagla 8ed56ec293 네이버 소셜회원가입시 월/일 처리가 반대로 되는 현상 수정 (arrtres님,210727) 2021-07-28 11:19:45 +09:00
kagla ed3143b6fd 버전 5.4.13.1 수정중 2021-07-27 05:28:16 +00:00
kagla 1491ae6e17 잘못된 webp 검사 함수명 file_exists를 function_exists로 수정 2021-07-27 05:27:06 +00:00
EC2 Default User b29ced4553 버전 5.4.13 수정 2021-07-27 00:46:51 +00:00
EC2 Default User 77064a40c6 쇼핑몰을 사용하지 않을 경우 나오는 오류 수정 (열공중님,210723) 2021-07-26 03:17:22 +00:00
kagla 52ed0f3d64 움직이는 webp 이미지는 업로드 불가합니다. 문구를 삭제함 2021-07-24 06:18:56 +00:00
kagla d0e101b3e8 webp를 지원하는 서버에서만 이미지 업로드 확장자에 webp를 추가함 2021-07-24 06:18:20 +00:00
Cloud User 3f97138715 webp를 지원하지 않는 서버에서 경고 문구를 출력함 2021-07-24 06:16:22 +00:00
Cloud User d76b371a58 Merge branch '5.4.13' of github.com:gnuboard/gnuboard5 into 5.4.13 2021-07-21 04:54:28 +00:00
kagla 42bf3d6044 잘못된 주석 문구 수정 (해피정님,210720) 2021-07-20 14:49:01 +09:00
kagla 1d89af99b0 버전 5.4.12 수정 2021-07-20 01:23:06 +00:00
EC2 Default User 81635f7737 PHP 5 하위버전에서 상수 배열이 지원되지 않아 나오던 오류 수정 (한별아빠님,210719) 2021-07-20 01:20:35 +00:00
EC2 Default User e1e20f2dc2 skin 디렉토리가 없거나 경로가 잘못 된 경우 나오는 나오는 오류 수정 PHP Warning: array_merge(): Argument #2 is not an array (엑스엠엘님,210716) 2021-07-20 01:07:56 +00:00
kagla 0260fb9e33 버전 5.4.11 수정 2021-07-19 11:53:41 +09:00
kagla d9e6342c09 ckeditor4 는 별도의 브랜치에서 관리하기 위해 삭제함 2021-07-19 11:17:38 +09:00
kagla 8abf0dfcae Merge branch 'dhtml-editor' of github.com:gnuboard/gnuboard5 into dhtml-editor 2021-07-19 11:13:45 +09:00
kagla c2ce0f1d95 Merge branch 'reaonly' 2021-07-19 10:01:18 +09:00
kagla 4183ae5a42 Merge branch 'inicis-cancel' 2021-07-19 10:00:04 +09:00
kagla 8468a87f26 잘못 선언된 변수 $reaonly 를 삭제하고, $required_value 변수의 위치를 옮김 (작은별님,210718) 2021-07-19 09:58:31 +09:00
kagla fdbbe2d307 php5.x 버전에서만 stripslashes 가 되지 않는 오류가 있어 php 7.0 미만 버전에서 get_magic_quotes_gpc 가 실행되도록 예전 코드를 되돌림 2021-07-19 09:42:53 +09:00
kagla 9bc012f7f8 모바일결제에서 결제금액 불일치시 결제를 취소해야하는 이니시스 코드 누락되어 추가함. (위토즈님,210714) 2021-07-14 12:34:48 +09:00
kagla 76bbc41043 Merge pull request #79 from projectSylas/ckeditor4
editor 별 익스플로러 alert 안내문 추가
2021-07-06 15:41:32 +09:00
kagla bda235bf01 Merge branch 'dhtml-editor' into ckeditor4 2021-07-06 15:41:07 +09:00
projectSylas 57e41498bc 에디터 별 익스플로러 안내문 추가 2021-07-06 06:26:40 +00:00
kagla a58bc5d2fb 버전 5.4.10 수정 2021-07-01 11:55:00 +09:00
kagla ff9f5ee936 문자열 안에 포함된 변수에 {중괄호} 적용 (해피정님,210625) 2021-07-01 11:52:11 +09:00
kagla 69e37cbec9 그누보드, 영카트 통합으로 인하여 게시판그룹을 커뮤니티(community)로 생성 (NaviGator님,210624) 2021-07-01 11:43:07 +09:00
kagla f631b3dca7 KISA 취약점 권고사항 Stored XSS (210624) 2021-07-01 10:59:16 +09:00
kagla e3a7dfd319 관련상품을 삭제한 뒤에 경고가 노출되어 등록, 수정 없이 관련상품만 삭제될 수 있는 오류 수정 (squared2님,210617) 2021-07-01 10:42:11 +09:00
kagla 94cd7b2979 음수 입력 하지 못하도록 수정 2021-07-01 10:41:53 +09:00
projectSylas 6b293876da cheditor 익스플로러 안내문구 추가 2021-06-29 07:52:11 +00:00
kagla cf3570586a ss_qa_write_token 세션값이 넘어가지 않아 답변등록 되지 않던 오류를 해결하기 위해 추가함 2021-06-28 14:12:43 +09:00
kagla d8df299366 class EditorImage 추가 2021-06-26 08:20:09 +09:00
kagla b3b92d4e1c cheditor4 first commit 2021-06-25 11:26:13 +00:00
EC2 Default User f27e4c3c0c 설치시 환경설정 > 이미지 업로드 확장자에 webp 추가 2021-06-25 05:43:06 +00:00
kagla bd33a31a10 움직이는 webp 이미지 업로드 가능하도록 수정중 2021-06-25 14:03:45 +09:00
kagla 8ac1d25242 이미지 확장자 상수 선언 2021-06-25 14:03:38 +09:00
kagla cfc6804ee5 버전 5.4.9 수정 2021-06-24 06:46:52 +00:00
kagla 395725a2b5 Merge branch 'master' of https://github.com/gnuboard/gnuboard5 2021-06-24 06:43:09 +00:00
kagla e928df8a8c 현재 false 값만 반환하는 get_magic_quotes_gpc() 관련 코드 제거, PHP7.4.0에서 DEPRECATED 되었습니다. (엑스엠엘님,210624) 2021-06-24 06:42:38 +00:00
EC2 Default User 911503e055 $subject 가 첫번째 조건에 만족하면 $cont 를 초기화 하지 못하는 보안 취약점 수정 (munsiwoo님,210623) 2021-06-24 05:39:11 +00:00
EC2 Default User cc2524e3a4 갤러리 이미지수 설정을 select type 에서 input type 으로 수정 (사노라가노라님,210223) 2021-06-24 04:58:52 +00:00
Ubuntu c82add0eca webp 지원하도록 수정중 2021-06-24 04:31:02 +00:00
EC2 Default User d4a63cd105 PHP 8.x 에서 data/dbconfig.php 의 define('G5_USE_SHOP', false); 와 같이 영카트 사용 안함 설정시 나오는 오류 수정 (몰라무서워님외,210623) 2021-06-23 02:50:45 +00:00
kagla 58f5e9b5cd cheditor5 에 webp 이미지 업로드 할 수 있도록 수정. 움직이는 gif, webp 의 이미지가 정지되어 업로드 되고 있음. 원래 그런것 같음. 2021-06-23 09:18:48 +09:00
kagla 74798b93c1 webp 확장자를 추가하여 용량 큰 webp 파일이 업로드 되는 것을 확인함 2021-06-22 16:43:21 +09:00
kagla 178886c87a webp 이미지를 업로드 할 수 있도록 수정 중 2021-06-22 16:07:02 +09:00
EC2 Default User 01c5771c16 PHP 8.x 버전에서 G5_USE_SHOP 이 false 인 경우 테마를 사용하는 경우에 상수 부분에서 발생하는 오류 수정 (dinist님,210618) 2021-06-21 02:38:57 +00:00
kagla 0e9a234dfb 그누보드 버전 5.4.8 수정 2021-06-18 13:57:31 +09:00
kagla 3fa43d55af G5_USE_SHOP 이 false 인 경우 자바스크립트 g5_shop_url 변수 선언하지 않음 2021-06-18 13:51:00 +09:00
kagla 7daa07b53f G5_USE_SHOP 이 false 인 경우 상단의 쇼핑몰 아이콘 제거 2021-06-18 13:50:14 +09:00
kagla 7a40546c4a G5_GNUBOARD_VER 을 extend/version.extend.php 로 옮긴것을 config.php 로 되돌림 2021-06-18 13:33:39 +09:00
kagla fefccdb353 그누보드 버전 5.4.7 수정 2021-06-18 09:57:46 +09:00
kagla 7a166ea47b config.php 에 있던 그누보드와 영카트 버전 상수를 이곳으로 옮김 2021-06-18 09:56:42 +09:00
kagla 907bdfc66e 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전이 통합됨에 따라 관리자 하단에 그누보드 버전만 표시 2021-06-18 09:49:38 +09:00
kagla d8e161eaea 그누보드와 영카트 버전 상수를 extend/version.extend.php 로 옮김 2021-06-18 09:48:06 +09:00
kagla 8ea99dda00 class 중간에 잘못 입력된 "(쌍따옴표) 한개 제거 (해피정님,210610) 2021-06-17 17:15:05 +09:00
kagla 3da6e9ff60 $sum['cnt'] 가 null 일때 재고 반영이 제대로 안되는 오류 수정 (그누위즈님,210614) 2021-06-17 16:17:45 +09:00
kagla b986729466 dbconfig.php 에서 define('G5_USE_SHOP', false); 설정시 '쇼핑몰' 문구 나오지 않도록 수정 2021-06-17 15:30:21 +09:00
48 changed files with 464 additions and 319 deletions

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ test.php
log log
g5_tree g5_tree
cheditor5.*/ cheditor5.*/
ckeditor*/ !ckeditor*/
log/ log/
g5_tree/ g5_tree/
.vscode/ .vscode/
+2
View File
@@ -111,7 +111,9 @@ function imageview(id, w, h)
<div id="tnb"> <div id="tnb">
<ul> <ul>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li class="tnb_li"><a href="<?php echo G5_SHOP_URL ?>/" class="tnb_shop" target="_blank" title="쇼핑몰 바로가기">쇼핑몰 바로가기</a></li> <li class="tnb_li"><a href="<?php echo G5_SHOP_URL ?>/" class="tnb_shop" target="_blank" title="쇼핑몰 바로가기">쇼핑몰 바로가기</a></li>
<?php } ?>
<li class="tnb_li"><a href="<?php echo G5_URL ?>/" class="tnb_community" target="_blank" title="커뮤니티 바로가기">커뮤니티 바로가기</a></li> <li class="tnb_li"><a href="<?php echo G5_URL ?>/" class="tnb_community" target="_blank" title="커뮤니티 바로가기">커뮤니티 바로가기</a></li>
<li class="tnb_li"><a href="<?php echo G5_ADMIN_URL ?>/service.php" class="tnb_service">부가서비스</a></li> <li class="tnb_li"><a href="<?php echo G5_ADMIN_URL ?>/service.php" class="tnb_service">부가서비스</a></li>
<li class="tnb_li"><button type="button" class="tnb_mb_btn">관리자<span class="./img/btn_gnb.png">메뉴열기</span></button> <li class="tnb_li"><button type="button" class="tnb_mb_btn">관리자<span class="./img/btn_gnb.png">메뉴열기</span></button>
+1 -1
View File
@@ -83,7 +83,7 @@ function get_skin_dir($skin, $skin_path=G5_SKIN_PATH)
$dirname = $skin_path.'/'.$skin.'/'; $dirname = $skin_path.'/'.$skin.'/';
if(!is_dir($dirname)) if(!is_dir($dirname))
return; return array();
$handle = opendir($dirname); $handle = opendir($dirname);
while ($file = readdir($handle)) { while ($file = readdir($handle)) {
+3 -1
View File
@@ -1,7 +1,9 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; if (!defined('_GNUBOARD_')) exit;
$print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER; // 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전이 통합됨에 따라 그누보드 버전만 표시
// $print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
$print_version = 'Version '.G5_GNUBOARD_VER;
?> ?>
<noscript> <noscript>
+2 -3
View File
@@ -11,8 +11,6 @@ if (!$row['cnt'])
alert('게시판그룹이 한개 이상 생성되어야 합니다.', './boardgroup_form.php'); alert('게시판그룹이 한개 이상 생성되어야 합니다.', './boardgroup_form.php');
$html_title = '게시판'; $html_title = '게시판';
$reaonly = '';
$required_valid = '';
if (!isset($board['bo_device'])) { if (!isset($board['bo_device'])) {
// 게시판 사용 필드 추가 // 게시판 사용 필드 추가
@@ -142,6 +140,7 @@ run_event('adm_board_form_before', $board, $w);
$required = ""; $required = "";
$readonly = ""; $readonly = "";
$sound_only = ""; $sound_only = "";
$required_valid = "";
if ($w == '') { if ($w == '') {
$html_title .= ' 생성'; $html_title .= ' 생성';
@@ -1062,7 +1061,7 @@ $pg_anchor = '<ul class="anchor">
<th scope="row"><label for="bo_gallery_cols">갤러리 이미지 수<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="bo_gallery_cols">갤러리 이미지 수<strong class="sound_only">필수</strong></label></th>
<td> <td>
<?php echo help('갤러리 형식의 게시판 목록에서 이미지를 한줄에 몇장씩 보여 줄 것인지를 설정하는 값') ?> <?php echo help('갤러리 형식의 게시판 목록에서 이미지를 한줄에 몇장씩 보여 줄 것인지를 설정하는 값') ?>
<?php echo get_member_level_select('bo_gallery_cols', 1, 10, $board['bo_gallery_cols']); ?> <input type="text" name="bo_gallery_cols" value="<?php echo $board['bo_gallery_cols'] ?>" id="bo_gallery_cols" required class="required numeric frm_input" size="4">
</td> </td>
<td class="td_grpset"> <td class="td_grpset">
<input type="checkbox" name="chk_grp_gallery_cols" value="1" id="chk_grp_gallery_cols"> <input type="checkbox" name="chk_grp_gallery_cols" value="1" id="chk_grp_gallery_cols">
+9
View File
@@ -1530,4 +1530,13 @@ if($config['cf_cert_use']) {
} }
} }
if (stripos($config['cf_image_extension'], "webp") !== false) {
if (!function_exists("imagewebp")) {
echo '<script>'.PHP_EOL;
echo 'alert("이 서버는 webp 이미지를 지원하고 있지 않습니다.\n이미지 업로드 확장자에서 webp 확장자를 제거해 주십시오.\n제거하지 않으면 이미지와 관련된 오류가 발생할 수 있습니다.");'.PHP_EOL;
echo 'document.getElementById("cf_image_extension").focus();'.PHP_EOL;
echo '</script>'.PHP_EOL;
}
}
include_once ('./admin.tail.php'); include_once ('./admin.tail.php');
+25 -23
View File
@@ -177,31 +177,33 @@ if( !$row ) {
$is_check = true; $is_check = true;
} }
// 임시저장 테이블이 없을 경우 생성 if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) { // 임시저장 테이블이 없을 경우 생성
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` ( if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) {
`log_id` int(11) NOT NULL AUTO_INCREMENT, sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` (
`oid` bigint(20) unsigned NOT NULL, `log_id` int(11) NOT NULL AUTO_INCREMENT,
`mb_id` varchar(255) NOT NULL DEFAULT '', `oid` bigint(20) unsigned NOT NULL,
`post_data` text NOT NULL, `mb_id` varchar(255) NOT NULL DEFAULT '',
`ol_code` varchar(255) NOT NULL DEFAULT '', `post_data` text NOT NULL,
`ol_msg` text NOT NULL, `ol_code` varchar(255) NOT NULL DEFAULT '',
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ol_msg` text NOT NULL,
`ol_ip` varchar(25) NOT NULL DEFAULT '', `ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`log_id`) `ol_ip` varchar(25) NOT NULL DEFAULT '',
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", true); PRIMARY KEY (`log_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", true);
$is_check = true;
}
$result = sql_query("describe `{$g5['g5_shop_post_log_table']}`");
while ($row = sql_fetch_array($result)){
if( $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` MODIFY ol_msg TEXT NOT NULL;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` DROP PRIMARY KEY;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` ADD `log_id` int(11) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`log_id`);", false);
$is_check = true; $is_check = true;
break; }
$result = sql_query("describe `{$g5['g5_shop_post_log_table']}`");
while ($row = sql_fetch_array($result)){
if( $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` MODIFY ol_msg TEXT NOT NULL;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` DROP PRIMARY KEY;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` ADD `log_id` int(11) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`log_id`);", false);
$is_check = true;
break;
}
} }
} }
+3 -1
View File
@@ -65,9 +65,11 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
<td> <td>
<?php echo help("커뮤니티에 표시될 것인지 쇼핑몰에 표시될 것인지를 설정합니다."); ?> <?php echo help("커뮤니티에 표시될 것인지 쇼핑몰에 표시될 것인지를 설정합니다."); ?>
<select name="nw_division" id="nw_division"> <select name="nw_division" id="nw_division">
<option value="both"<?php echo get_selected($nw['nw_division'], 'both', true); ?>>커뮤니티와 쇼핑몰</option>
<option value="comm"<?php echo get_selected($nw['nw_division'], 'comm'); ?>>커뮤니티</option> <option value="comm"<?php echo get_selected($nw['nw_division'], 'comm'); ?>>커뮤니티</option>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<option value="both"<?php echo get_selected($nw['nw_division'], 'both', true); ?>>커뮤니티와 쇼핑몰</option>
<option value="shop"<?php echo get_selected($nw['nw_division'], 'shop'); ?>>쇼핑몰</option> <option value="shop"<?php echo get_selected($nw['nw_division'], 'shop'); ?>>쇼핑몰</option>
<?php } ?>
</select> </select>
</td> </td>
</tr> </tr>
+1 -1
View File
@@ -1602,7 +1602,7 @@ function byte_check(el_cont, el_byte)
<input type="password" name="cf_icode_pw" value="<?php echo get_sanitize_input($config['cf_icode_pw']); ?>" class="frm_input" id="cf_icode_pw"> <input type="password" name="cf_icode_pw" value="<?php echo get_sanitize_input($config['cf_icode_pw']); ?>" class="frm_input" id="cf_icode_pw">
</td> </td>
</tr> </tr>
<tr class="icode_old_version" <?php if(!(isset($userinfo['payment']) && $userinfo['payment'])){ echo 'cf_tr_hide'; } ?>"> <tr class="icode_old_version <?php if(!(isset($userinfo['payment']) && $userinfo['payment'])){ echo 'cf_tr_hide'; } ?>">
<th scope="row">요금제<br>(구버전)</th> <th scope="row">요금제<br>(구버전)</th>
<td> <td>
<input type="hidden" name="cf_icode_server_ip" value="<?php echo get_sanitize_input($config['cf_icode_server_ip']); ?>"> <input type="hidden" name="cf_icode_server_ip" value="<?php echo get_sanitize_input($config['cf_icode_server_ip']); ?>">
+3 -1
View File
@@ -1843,8 +1843,10 @@ function fitemformcheck(f)
if(f.it_point_type.value == "1" || f.it_point_type.value == "2") { if(f.it_point_type.value == "1" || f.it_point_type.value == "2") {
var point = parseInt(f.it_point.value); var point = parseInt(f.it_point.value);
if(point > 99) { if(point < 0 || point > 99) {
alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오."); alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오.");
f.it_point.focus();
f.it_point.select();
return false; return false;
} }
} }
+4 -4
View File
@@ -218,6 +218,10 @@ if ($w == "" || $w == "u")
@set_cookie("ck_origin", stripslashes($it_origin), time() + 86400*31); @set_cookie("ck_origin", stripslashes($it_origin), time() + 86400*31);
} }
// 관련상품을 삭제한 뒤에 경고가 노출되어 등록, 수정 없이 관련상품만 삭제될 수 있는 오류 수정 (squared2님,210617)
// 포인트 비율 값 체크
if(($it_point_type == 1 || $it_point_type == 2) && ($it_point < 0 || $it_point > 99))
alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오.");
// 관련상품을 우선 삭제함 // 관련상품을 우선 삭제함
sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id = '$it_id' "); sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id = '$it_id' ");
@@ -287,10 +291,6 @@ for($i=0; $i<$count_ii_article; $i++) {
} }
$it_info_value = addslashes(serialize($value_array)); $it_info_value = addslashes(serialize($value_array));
// 포인트 비율 값 체크
if(($it_point_type == 1 || $it_point_type == 2) && $it_point > 99)
alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오.");
$it_name = isset($_POST['it_name']) ? strip_tags(clean_xss_attributes(trim($_POST['it_name']))) : ''; $it_name = isset($_POST['it_name']) ? strip_tags(clean_xss_attributes(trim($_POST['it_name']))) : '';
// KVE-2019-0708 // KVE-2019-0708
+25 -23
View File
@@ -30,7 +30,7 @@ $qstr_device = '&amp;mode='.$mode.'&amp;device='.(G5_IS_MOBILE ? 'pc' : 'mobile
$sql = " select bo_table, wr_parent from {$g5['board_new_table']} order by bn_id desc limit 1 "; $sql = " select bo_table, wr_parent from {$g5['board_new_table']} order by bn_id desc limit 1 ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$bo_table = $row['bo_table']; $bo_table = $row['bo_table'];
$board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '$bo_table' "); $board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '{$bo_table}' ");
$write_table = $g5['write_prefix'] . $bo_table; $write_table = $g5['write_prefix'] . $bo_table;
// theme.config.php 미리보기 게시판 스킨이 설정돼 있다면 // theme.config.php 미리보기 게시판 스킨이 설정돼 있다면
@@ -100,29 +100,31 @@ for($i=1; $i<=5; $i++) {
$default['de_mimg_width'] = (isset($tconfig['de_mimg_width']) && $tconfig['de_mimg_width']) ? $tconfig['de_mimg_width'] : $default['de_mimg_width']; $default['de_mimg_width'] = (isset($tconfig['de_mimg_width']) && $tconfig['de_mimg_width']) ? $tconfig['de_mimg_width'] : $default['de_mimg_width'];
$default['de_mimg_height'] = (isset($tconfig['de_mimg_height']) && $tconfig['de_mimg_height']) ? $tconfig['de_mimg_height'] : $default['de_mimg_height']; $default['de_mimg_height'] = (isset($tconfig['de_mimg_height']) && $tconfig['de_mimg_height']) ? $tconfig['de_mimg_height'] : $default['de_mimg_height'];
// 테마 경로 설정 if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
if(defined('G5_THEME_PATH')) { // 테마 경로 설정
define('G5_THEME_SHOP_PATH', G5_THEME_PATH.'/'.G5_SHOP_DIR); if(defined('G5_THEME_PATH')) {
define('G5_THEME_SHOP_URL', G5_THEME_URL.'/'.G5_SHOP_DIR); define('G5_THEME_SHOP_PATH', G5_THEME_PATH.'/'.G5_SHOP_DIR);
define('G5_THEME_MSHOP_PATH', G5_THEME_PATH.'/'.G5_MOBILE_DIR.'/'.G5_SHOP_DIR); define('G5_THEME_SHOP_URL', G5_THEME_URL.'/'.G5_SHOP_DIR);
define('G5_THEME_MSHOP_URL', G5_THEME_URL.'/'.G5_MOBILE_DIR.'/'.G5_SHOP_DIR); define('G5_THEME_MSHOP_PATH', G5_THEME_PATH.'/'.G5_MOBILE_DIR.'/'.G5_SHOP_DIR);
} define('G5_THEME_MSHOP_URL', G5_THEME_URL.'/'.G5_MOBILE_DIR.'/'.G5_SHOP_DIR);
}
// 스킨 경로 설정 // 스킨 경로 설정
if(preg_match('#^theme/(.+)$#', $default['de_shop_skin'], $match)) { if(preg_match('#^theme/(.+)$#', $default['de_shop_skin'], $match)) {
define('G5_SHOP_SKIN_PATH', G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1]); define('G5_SHOP_SKIN_PATH', G5_THEME_PATH.'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$match[1]);
define('G5_SHOP_SKIN_URL', G5_THEME_URL .'/'.G5_SKIN_DIR.'/shop/'.$match[1]); define('G5_SHOP_SKIN_URL', G5_THEME_URL .'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$match[1]);
} else { } else {
define('G5_SHOP_SKIN_PATH', G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_skin']); define('G5_SHOP_SKIN_PATH', G5_PATH.'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$default['de_shop_skin']);
define('G5_SHOP_SKIN_URL', G5_URL .'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_skin']); define('G5_SHOP_SKIN_URL', G5_URL .'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$default['de_shop_skin']);
} }
if(preg_match('#^theme/(.+)$#', $default['de_shop_mobile_skin'], $match)) { if(preg_match('#^theme/(.+)$#', $default['de_shop_mobile_skin'], $match)) {
define('G5_MSHOP_SKIN_PATH', G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1]); define('G5_MSHOP_SKIN_PATH', G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$match[1]);
define('G5_MSHOP_SKIN_URL', G5_THEME_URL .'/'.G5_MOBILE_DIR.'/'.G5_SKIN_DIR.'/shop/'.$match[1]); define('G5_MSHOP_SKIN_URL', G5_THEME_URL .'/'.G5_MOBILE_DIR.'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$match[1]);
} else { } else {
define('G5_MSHOP_SKIN_PATH', G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']); define('G5_MSHOP_SKIN_PATH', G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$default['de_shop_mobile_skin']);
define('G5_MSHOP_SKIN_URL', G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']); define('G5_MSHOP_SKIN_URL', G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/'.G5_SHOP_DIR.'/'.$default['de_shop_mobile_skin']);
}
} }
$conf = sql_fetch(" select cf_theme from {$g5['config_table']} "); $conf = sql_fetch(" select cf_theme from {$g5['config_table']} ");
@@ -170,7 +172,7 @@ require_once(G5_PATH.'/head.sub.php');
break; break;
case 'view': case 'view':
$wr_id = $row['wr_parent']; $wr_id = $row['wr_parent'];
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' "); $write = sql_fetch(" select * from {$write_table} where wr_id = '{$wr_id}' ");
include(G5_BBS_PATH.'/board.php'); include(G5_BBS_PATH.'/board.php');
break; break;
case 'shop': case 'shop':
+2 -3
View File
@@ -11,7 +11,7 @@ for ($i=0; $i<count($filter); $i++) {
$str = $filter[$i]; $str = $filter[$i];
// 제목 필터링 (찾으면 중지) // 제목 필터링 (찾으면 중지)
$subj = ""; $subj = $cont = "";
$pos = stripos($subject, $str); $pos = stripos($subject, $str);
if ($pos !== false) { if ($pos !== false) {
$subj = $str; $subj = $str;
@@ -19,7 +19,6 @@ for ($i=0; $i<count($filter); $i++) {
} }
// 내용 필터링 (찾으면 중지) // 내용 필터링 (찾으면 중지)
$cont = "";
$pos = stripos($content, $str); $pos = stripos($content, $str);
if ($pos !== false) { if ($pos !== false) {
$cont = $str; $cont = $str;
@@ -27,4 +26,4 @@ for ($i=0; $i<count($filter); $i++) {
} }
} }
die("{\"subject\":\"$subj\",\"content\":\"$cont\"}"); die("{\"subject\":\"{$subj}\",\"content\":\"{$cont}\"}");
+1
View File
@@ -12,6 +12,7 @@ $content = '';
$token = _token(); $token = _token();
set_session('ss_qa_delete_token', $token); set_session('ss_qa_delete_token', $token);
set_session('ss_qa_write_token', $token);
$g5['title'] = $qaconfig['qa_title']; $g5['title'] = $qaconfig['qa_title'];
include_once('./qahead.php'); include_once('./qahead.php');
+2 -1
View File
@@ -79,7 +79,8 @@ if(is_file($skin_file)) {
else else
$content = "\n\n\n\n====== 이전 답변내용 =======\n"; $content = "\n\n\n\n====== 이전 답변내용 =======\n";
$content .= get_text($write['qa_content'], 0); // KISA 취약점 권고사항 Stored XSS (210624)
$content .= get_text(html_purifier($write['qa_content']), 0);
} else { } else {
//$content = get_text($write['qa_content'], 0); //$content = get_text($write['qa_content'], 0);
+2 -1
View File
@@ -197,7 +197,8 @@ for ($i=1; $i<=$upload_count; $i++) {
// image type // image type
if ( preg_match("/\.({$config['cf_image_extension']})$/i", $filename) || if ( preg_match("/\.({$config['cf_image_extension']})$/i", $filename) ||
preg_match("/\.({$config['cf_flash_extension']})$/i", $filename) ) { preg_match("/\.({$config['cf_flash_extension']})$/i", $filename) ) {
if ($timg['2'] < 1 || $timg['2'] > 16) // webp 파일의 type 이 18 이므로 업로드가 가능하도록 수정
if ($timg['2'] < 1 || $timg['2'] > 18)
continue; continue;
} }
//================================================================= //=================================================================
+1 -1
View File
@@ -12,7 +12,7 @@ if(function_exists('clean_relative_paths')){
$extension = pathinfo($filename, PATHINFO_EXTENSION); $extension = pathinfo($filename, PATHINFO_EXTENSION);
if ( ! preg_match('/(jpg|jpeg|png|gif|bmp)$/i', $extension) ){ if ( ! preg_match('/(jpg|jpeg|png|gif|bmp|webp)$/i', $extension) ){
alert_close('이미지 확장자가 아닙니다.'); alert_close('이미지 확장자가 아닙니다.');
} }
+5
View File
@@ -29,6 +29,11 @@ if ($w == 'u' || $w == 'r') {
} else { } else {
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL); alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL);
} }
} else if ($w == '') { // 게시글 입력시에도 $wr_1 ~ $wr_10 변수 사용시 오류 나오지 않도록 가변변수 생성 (다온테마님,210806)
for ($i=1; $i<=10; $i++) {
$vvar = "wr_".$i;
$$vvar = '';
}
} }
run_event('bbs_write', $board, $wr_id, $w); run_event('bbs_write', $board, $wr_id, $w);
+1 -1
View File
@@ -532,7 +532,7 @@ if(isset($_FILES['bf_file']['name']) && is_array($_FILES['bf_file']['name'])) {
// image type // image type
if ( preg_match("/\.({$config['cf_image_extension']})$/i", $filename) || if ( preg_match("/\.({$config['cf_image_extension']})$/i", $filename) ||
preg_match("/\.({$config['cf_flash_extension']})$/i", $filename) ) { preg_match("/\.({$config['cf_flash_extension']})$/i", $filename) ) {
if ($timg['2'] < 1 || $timg['2'] > 16) if ($timg['2'] < 1 || $timg['2'] > 18)
continue; continue;
} }
//================================================================= //=================================================================
+7 -5
View File
@@ -102,11 +102,13 @@ function sql_escape_string($str)
// SQL Injection 등으로 부터 보호를 위해 sql_escape_string() 적용 // SQL Injection 등으로 부터 보호를 위해 sql_escape_string() 적용
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// magic_quotes_gpc 에 의한 backslashes 제거 // magic_quotes_gpc 에 의한 backslashes 제거
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { if (7.0 > (float)phpversion()) {
$_POST = array_map_deep('stripslashes', $_POST); if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$_GET = array_map_deep('stripslashes', $_GET); $_POST = array_map_deep('stripslashes', $_POST);
$_COOKIE = array_map_deep('stripslashes', $_COOKIE); $_GET = array_map_deep('stripslashes', $_GET);
$_REQUEST = array_map_deep('stripslashes', $_REQUEST); $_COOKIE = array_map_deep('stripslashes', $_COOKIE);
$_REQUEST = array_map_deep('stripslashes', $_REQUEST);
}
} }
// sql_escape_string 적용 // sql_escape_string 적용
+4 -2
View File
@@ -5,9 +5,11 @@
********************/ ********************/
define('G5_VERSION', '그누보드5'); define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.4.6'); define('G5_GNUBOARD_VER', '5.4.14');
// 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전을 합쳐서 그누보드5.4.6 버전에서 시작함 (kagla-210617) // 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전을 합쳐서 그누보드5.4.6 버전에서 시작함 (kagla-210617)
// define('G5_YOUNGCART_VER', '5.4.5.5.1'); // G5_YOUNGCART_VER 이 상수를 사용하는 곳이 있으므로 주석 처리 해제함
// 그누보드5.4.6 이상 버전 부터는 영카트를 그누보드에 포함하여 배포하므로 영카트5의 버전은 의미가 없습니다.
define('G5_YOUNGCART_VER', '5.4.5.5.1');
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음 // 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
define('_GNUBOARD_', true); define('_GNUBOARD_', true);
+5 -2
View File
@@ -1,5 +1,8 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
define('G5_JS_VER', '191202'); // 자바스크립트와 CSS 파일을 새로 다운로드 하도록 파일의 끝에 년월일 지정
define('G5_CSS_VER', '191202'); // 예) https://도메인/css/default.css?ver=210618
// 예) https://도메인/js/common.js?ver=210618
define('G5_CSS_VER', '210618');
define('G5_JS_VER', '210618');
+2
View File
@@ -38,7 +38,9 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
<?php if(defined('G5_COMMUNITY_USE') == false || G5_COMMUNITY_USE) { ?> <?php if(defined('G5_COMMUNITY_USE') == false || G5_COMMUNITY_USE) { ?>
<ul id="hd_define"> <ul id="hd_define">
<li class="active"><a href="<?php echo G5_URL ?>/">커뮤니티</a></li> <li class="active"><a href="<?php echo G5_URL ?>/">커뮤니티</a></li>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li><a href="<?php echo G5_SHOP_URL ?>/">쇼핑몰</a></li> <li><a href="<?php echo G5_SHOP_URL ?>/">쇼핑몰</a></li>
<?php } ?>
</ul> </ul>
<?php } ?> <?php } ?>
<ul id="hd_qnb"> <ul id="hd_qnb">
+2
View File
@@ -79,7 +79,9 @@ var g5_bo_table = "<?php echo isset($bo_table)?$bo_table:''; ?>";
var g5_sca = "<?php echo isset($sca)?$sca:''; ?>"; var g5_sca = "<?php echo isset($sca)?$sca:''; ?>";
var g5_editor = "<?php echo ($config['cf_editor'] && $board['bo_use_dhtml_editor'])?$config['cf_editor']:''; ?>"; var g5_editor = "<?php echo ($config['cf_editor'] && $board['bo_use_dhtml_editor'])?$config['cf_editor']:''; ?>";
var g5_cookie_domain = "<?php echo G5_COOKIE_DOMAIN ?>"; var g5_cookie_domain = "<?php echo G5_COOKIE_DOMAIN ?>";
<?php if(defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
var g5_shop_url = "<?php echo G5_SHOP_URL; ?>"; var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
<?php } ?>
<?php if(defined('G5_IS_ADMIN')) { ?> <?php if(defined('G5_IS_ADMIN')) { ?>
var g5_admin_url = "<?php echo G5_ADMIN_URL; ?>"; var g5_admin_url = "<?php echo G5_ADMIN_URL; ?>";
<?php } ?> <?php } ?>
+13 -3
View File
@@ -141,6 +141,13 @@ $download_point = 0;
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// config 테이블 설정 // config 테이블 설정
if($g5_install || !$result) { if($g5_install || !$result) {
// 기본 이미지 확장자를 설정하고
$image_extension = "gif|jpg|jpeg|png";
// 서버에서 webp 를 지원하면 확장자를 추가한다.
if (function_exists("imagewebp")) {
$image_extension .= "|webp";
}
$sql = " insert into `{$table_prefix}config` $sql = " insert into `{$table_prefix}config`
set cf_title = '".G5_VERSION."', set cf_title = '".G5_VERSION."',
cf_theme = 'basic', cf_theme = 'basic',
@@ -197,7 +204,7 @@ if($g5_install || !$result) {
cf_member_img_width = '60', cf_member_img_width = '60',
cf_member_img_height = '60', cf_member_img_height = '60',
cf_login_minutes = '10', cf_login_minutes = '10',
cf_image_extension = 'gif|jpg|jpeg|png', cf_image_extension = '{$image_extension}',
cf_flash_extension = 'swf', cf_flash_extension = 'swf',
cf_movie_extension = 'asx|asf|wmv|wma|mpg|mpeg|mov|avi|mp3', cf_movie_extension = 'asx|asf|wmv|wma|mpg|mpeg|mov|avi|mp3',
cf_formmail_is_member = '1', cf_formmail_is_member = '1',
@@ -241,8 +248,11 @@ if($g5_install || !$result) {
// FAQ Master // FAQ Master
sql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ", true, $dblink); sql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ", true, $dblink);
$tmp_gr_id = defined('G5_YOUNGCART_VER') ? 'shop' : 'community'; // 그누보드, 영카트 통합으로 인하여 게시판그룹을 커뮤니티(community)로 생성 (NaviGator님,210624)
$tmp_gr_subject = defined('G5_YOUNGCART_VER') ? '쇼핑몰' : '커뮤니티'; // $tmp_gr_id = defined('G5_YOUNGCART_VER') ? 'shop' : 'community';
// $tmp_gr_subject = defined('G5_YOUNGCART_VER') ? '쇼핑몰' : '커뮤니티';
$tmp_gr_id = 'community';
$tmp_gr_subject = '커뮤니티';
// 게시판 그룹 생성 // 게시판 그룹 생성
sql_query(" insert into `{$table_prefix}group` set gr_id = '$tmp_gr_id', gr_subject = '$tmp_gr_subject' ", true, $dblink); sql_query(" insert into `{$table_prefix}group` set gr_id = '$tmp_gr_id', gr_subject = '$tmp_gr_subject' ", true, $dblink);
+1 -1
View File
@@ -294,7 +294,7 @@ function get_thumbnail_find_cache($bo_table, $wr_id, $wr_key){
return get_write($write_table, $wr_id, true); return get_write($write_table, $wr_id, true);
} }
return get_board_file_db($bo_table, $wr_id, 'bf_file, bf_content', "and bf_type between '1' and '3'", true); return get_board_file_db($bo_table, $wr_id, 'bf_file, bf_content', "and bf_type in (1, 2, 3, 18) ", true);
} }
function get_write_table_name($bo_table){ function get_write_table_name($bo_table){
+1 -1
View File
@@ -70,7 +70,7 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=
} }
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len); $list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
$list[$i]['first_file_thumb'] = (isset($row['wr_file']) && $row['wr_file']) ? get_board_file_db($bo_table, $row['wr_id'], 'bf_file, bf_content', "and bf_type between '1' and '3'", true) : array('bf_file'=>'', 'bf_content'=>''); $list[$i]['first_file_thumb'] = (isset($row['wr_file']) && $row['wr_file']) ? get_board_file_db($bo_table, $row['wr_id'], 'bf_file, bf_content', "and bf_type in (1, 2, 3, 18) ", true) : array('bf_file'=>'', 'bf_content'=>'');
$list[$i]['bo_table'] = $bo_table; $list[$i]['bo_table'] = $bo_table;
// 썸네일 추가 // 썸네일 추가
if($options && is_string($options)) { if($options && is_string($options)) {
+60 -20
View File
@@ -85,7 +85,7 @@ function get_file_thumbnail($file){
if( ! is_array($file) ) return ''; if( ! is_array($file) ) return '';
if( preg_match('/(\.jpg|\.jpeg|\.gif|\.png|\.bmp)$/i', $file['file']) && $contents = run_replace('get_file_thumbnail_tags', '', $file) ){ if( preg_match('/(\.jpg|\.jpeg|\.gif|\.png|\.bmp|\.webp)$/i', $file['file']) && $contents = run_replace('get_file_thumbnail_tags', '', $file) ){
return $contents; return $contents;
} else if ($file['view']) { } else if ($file['view']) {
return get_view_thumbnail($file['view']); return get_view_thumbnail($file['view']);
@@ -108,6 +108,8 @@ 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');
for($i=0; $i<count($matches[1]); $i++) { for($i=0; $i<count($matches[1]); $i++) {
$img = $matches[1][$i]; $img = $matches[1][$i];
@@ -138,8 +140,11 @@ function get_view_thumbnail($contents, $thumb_width=0)
if(empty($size)) if(empty($size))
continue; continue;
$file_ext = $extensions[$size[2]];
if (!$file_ext) continue;
// jpg 이면 exif 체크 // jpg 이면 exif 체크
if($size[2] == 2 && function_exists('exif_read_data')) { if( $file_ext === 'jpg' && function_exists('exif_read_data')) {
$degree = 0; $degree = 0;
$exif = @exif_read_data($srcfile); $exif = @exif_read_data($srcfile);
if(!empty($exif['Orientation'])) { if(!empty($exif['Orientation'])) {
@@ -166,7 +171,7 @@ function get_view_thumbnail($contents, $thumb_width=0)
// Animated GIF 체크 // Animated GIF 체크
$is_animated = false; $is_animated = false;
if($size[2] == 1) { if($file_ext === 'gif') {
$is_animated = is_animated_gif($srcfile); $is_animated = is_animated_gif($srcfile);
if($replace_content = run_replace('thumbnail_is_animated_gif_content', '', $contents, $srcfile, $is_animated, $img_tag, $data_path, $size)){ if($replace_content = run_replace('thumbnail_is_animated_gif_content', '', $contents, $srcfile, $is_animated, $img_tag, $data_path, $size)){
@@ -226,9 +231,20 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
if(!is_file($source_file)) // 원본 파일이 없다면 if(!is_file($source_file)) // 원본 파일이 없다면
return; return;
$size = @getimagesize($source_file); $size = @getimagesize($source_file);
if(!isset($size[2]) || $size[2] < 1 || $size[2] > 3) // gif, jpg, png 에 대해서만 적용
return; $extensions = array(1 => 'gif', 2 => 'jpg', 3 => 'png', 18 => 'webp');
$file_ext = $extensions[$size[2]]; // 파일 확장자
if (!$file_ext) return;
// gif, jpg, png, webp 에 대해서만 적용
// if ( !(isset($size[2]) && ($size[2] == 1 || $size[2] == 2 || $size[2] == 3 || $size[2] == 18)) )
// return;
// $extensions 배열에 없는 확장자 라면 썸네일 만들지 않음
// if (!in_array($file_ext, $extensions))
// return;
if (!is_dir($target_path)) { if (!is_dir($target_path)) {
@mkdir($target_path, G5_DIR_PERMISSION); @mkdir($target_path, G5_DIR_PERMISSION);
@@ -240,15 +256,18 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
return ''; return '';
// Animated GIF는 썸네일 생성하지 않음 // Animated GIF는 썸네일 생성하지 않음
if($size[2] == 1) { if($file_ext === 'gif') {
if(is_animated_gif($source_file)) if(is_animated_gif($source_file))
return basename($source_file); return basename($source_file);
} else if ($file_ext === 'webp') {
if(is_animated_webp($source_file))
return basename($source_file);
} }
$ext = array(1 => 'gif', 2 => 'jpg', 3 => 'png');
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거 $thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]]; // $thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]];
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$file_ext;
$thumb_time = @filemtime($thumb_file); $thumb_time = @filemtime($thumb_file);
$source_time = @filemtime($source_file); $source_time = @filemtime($source_file);
@@ -263,10 +282,10 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$src = null; $src = null;
$degree = 0; $degree = 0;
if ($size[2] == 1) { if ($file_ext === 'gif') {
$src = @imagecreatefromgif($source_file); $src = @imagecreatefromgif($source_file);
$src_transparency = @imagecolortransparent($src); $src_transparency = @imagecolortransparent($src);
} else if ($size[2] == 2) { } else if ($file_ext === 'jpg') {
$src = @imagecreatefromjpeg($source_file); $src = @imagecreatefromjpeg($source_file);
if(function_exists('exif_read_data')) { if(function_exists('exif_read_data')) {
@@ -298,9 +317,12 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
} }
} }
} }
} else if ($size[2] == 3) { } else if ($file_ext === 'png') {
$src = @imagecreatefrompng($source_file); $src = @imagecreatefrompng($source_file);
@imagealphablending($src, true); @imagealphablending($src, true);
} else if ($file_ext === 'webp') {
$src = @imagecreatefromwebp($source_file);
@imagealphablending($src, true);
} else { } else {
return; return;
} }
@@ -363,10 +385,10 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$dst = imagecreatetruecolor($dst_w, $dst_h); $dst = imagecreatetruecolor($dst_w, $dst_h);
if($size[2] == 3) { if($file_ext === 'png') {
imagealphablending($dst, false); imagealphablending($dst, false);
imagesavealpha($dst, true); imagesavealpha($dst, true);
} else if($size[2] == 1) { } else if($file_ext === 'gif') {
$palletsize = imagecolorstotal($src); $palletsize = imagecolorstotal($src);
if($src_transparency >= 0 && $src_transparency < $palletsize) { if($src_transparency >= 0 && $src_transparency < $palletsize) {
$transparent_color = imagecolorsforindex($src, $src_transparency); $transparent_color = imagecolorsforindex($src, $src_transparency);
@@ -391,12 +413,12 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
} }
} }
if($size[2] == 3) { if($file_ext === 'png') {
$bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127); $bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127);
imagefill($dst, 0, 0, $bgcolor); imagefill($dst, 0, 0, $bgcolor);
imagealphablending($dst, false); imagealphablending($dst, false);
imagesavealpha($dst, true); imagesavealpha($dst, true);
} else if($size[2] == 1) { } else if($file_ext === 'gif') {
$palletsize = imagecolorstotal($src); $palletsize = imagecolorstotal($src);
if($src_transparency >= 0 && $src_transparency < $palletsize) { if($src_transparency >= 0 && $src_transparency < $palletsize) {
$transparent_color = imagecolorsforindex($src, $src_transparency); $transparent_color = imagecolorsforindex($src, $src_transparency);
@@ -474,12 +496,12 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
} }
} }
if($size[2] == 3) { if($file_ext === 'png') {
$bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127); $bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127);
imagefill($dst, 0, 0, $bgcolor); imagefill($dst, 0, 0, $bgcolor);
imagealphablending($dst, false); imagealphablending($dst, false);
imagesavealpha($dst, true); imagesavealpha($dst, true);
} else if($size[2] == 1) { } else if($file_ext === 'gif') {
$palletsize = imagecolorstotal($src); $palletsize = imagecolorstotal($src);
if($src_transparency >= 0 && $src_transparency < $palletsize) { if($src_transparency >= 0 && $src_transparency < $palletsize) {
$transparent_color = imagecolorsforindex($src, $src_transparency); $transparent_color = imagecolorsforindex($src, $src_transparency);
@@ -502,22 +524,24 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
UnsharpMask($dst, $val[0], $val[1], $val[2]); UnsharpMask($dst, $val[0], $val[1], $val[2]);
} }
if($size[2] == 1) { if($file_ext === 'gif') {
imagegif($dst, $thumb_file); imagegif($dst, $thumb_file);
} else if($size[2] == 3) { } else if($file_ext === 'png') {
if(!defined('G5_THUMB_PNG_COMPRESS')) if(!defined('G5_THUMB_PNG_COMPRESS'))
$png_compress = 5; $png_compress = 5;
else else
$png_compress = G5_THUMB_PNG_COMPRESS; $png_compress = G5_THUMB_PNG_COMPRESS;
imagepng($dst, $thumb_file, $png_compress); imagepng($dst, $thumb_file, $png_compress);
} else { } else if ($file_ext === 'jpg') {
if(!defined('G5_THUMB_JPG_QUALITY')) if(!defined('G5_THUMB_JPG_QUALITY'))
$jpg_quality = 90; $jpg_quality = 90;
else else
$jpg_quality = G5_THUMB_JPG_QUALITY; $jpg_quality = G5_THUMB_JPG_QUALITY;
imagejpeg($dst, $thumb_file, $jpg_quality); imagejpeg($dst, $thumb_file, $jpg_quality);
} else if ($file_ext === 'webp') {
imagewebp($dst, $thumb_file);
} }
chmod($thumb_file, G5_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경 chmod($thumb_file, G5_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
@@ -695,6 +719,22 @@ and the roundoff errors in the Gaussian blur process, are welcome.
} }
// 움직이는 webp 파일인지 검사한다.
// 출처) https://stackoverflow.com/questions/45190469/how-to-identify-whether-webp-image-is-static-or-animated?answertab=votes#tab-top
function is_animated_webp($filename) {
$contents = file_get_contents($filename);
$where = strpos($contents, "ANMF");
if ($where !== false){
// animated
$is_animated = true;
}
else{
// non animated
$is_animated = false;
}
return $is_animated;
}
function is_animated_gif($filename) { function is_animated_gif($filename) {
static $cache = array(); static $cache = array();
+2
View File
@@ -68,7 +68,9 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
if ($i == 0) { ?> if ($i == 0) { ?>
<li id="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하세요.<?php } ?></li> <li id="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하세요.<?php } ?></li>
<?php } ?> <?php } ?>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li class="gnb_1dli"><a href="<?php echo G5_SHOP_URL ?>" class="gnb_1da"> 쇼핑몰</a></li> <li class="gnb_1dli"><a href="<?php echo G5_SHOP_URL ?>" class="gnb_1da"> 쇼핑몰</a></li>
<?php } ?>
</ul> </ul>
<ul id="hd_nb"> <ul id="hd_nb">
<li class="hd_nb1"><a href="<?php echo G5_BBS_URL ?>/faq.php" id="snb_faq"><i class="fa fa-question" aria-hidden="true"></i>FAQ</a></li> <li class="hd_nb1"><a href="<?php echo G5_BBS_URL ?>/faq.php" id="snb_faq"><i class="fa fa-question" aria-hidden="true"></i>FAQ</a></li>
+4 -1
View File
@@ -147,6 +147,9 @@ if((int)$pp['pp_price'] !== (int)$pg_price) {
case 'lg': case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php'; include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break; break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default: default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php'; include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break; break;
@@ -209,7 +212,7 @@ if($pp_receipt_price > 0 && $pp['pp_id'] && $pp['od_id']) {
where od_id = '{$pp['od_id']}' "; where od_id = '{$pp['od_id']}' ";
$result = sql_query($sql, false); $result = sql_query($sql, false);
// 결제정보 입력 오류시 kcp 결제 취소 // 결제정보 입력 오류시 결제 취소
if(!$result) { if(!$result) {
$cancel_msg = '결제정보 입력 오류'; $cancel_msg = '결제정보 입력 오류';
switch($default['de_pg_service']) { switch($default['de_pg_service']) {
@@ -9,10 +9,11 @@ if( !function_exists('che_reprocessImage') ){
function che_reprocessImage($file_path, $callback){ function che_reprocessImage($file_path, $callback){
$MIME_TYPES_PROCESSORS = array( $MIME_TYPES_PROCESSORS = array(
"image/gif" => array("imagecreatefromgif", "imagegif"), "image/gif" => array("imagecreatefromgif", "imagegif"),
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/png" => array("imagecreatefrompng", "imagepng"), "image/png" => array("imagecreatefrompng", "imagepng"),
"image/webp" => array("imagecreatefromwebp", "imagewebp"),
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp") "image/bmp" => array("imagecreatefromwbmp", "imagewbmp")
); );
@@ -84,6 +85,7 @@ switch ($type) {
case "jpeg": case "jpeg":
case "gif": case "gif":
case "png": case "png":
case "webp":
$found = true; $found = true;
} }
@@ -14,7 +14,7 @@
<div style="margin: 0px 0px 10px 0px;"> <div style="margin: 0px 0px 10px 0px;">
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();" <img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();"
alt="" style="vertical-align: middle" /> alt="" style="vertical-align: middle" />
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif" id="inputImageUpload" multiple="multiple" <input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif,image/webp" id="inputImageUpload" multiple="multiple"
onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/> onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/>
<img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()" <img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()"
style="vertical-align: middle; margin-left: -5px; cursor: pointer"/> style="vertical-align: middle; margin-left: -5px; cursor: pointer"/>
@@ -14,7 +14,7 @@
<div style="margin: 0px 0px 10px 0px;"> <div style="margin: 0px 0px 10px 0px;">
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();" <img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();"
alt="" style="vertical-align: middle" /> alt="" style="vertical-align: middle" />
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif" id="inputImageUpload" multiple="multiple" <input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif,image/webp" id="inputImageUpload" multiple="multiple"
onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/> onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/>
<img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()" <img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()"
style="vertical-align: middle; margin-left: -5px; cursor: pointer"/> style="vertical-align: middle; margin-left: -5px; cursor: pointer"/>
@@ -14,7 +14,7 @@ var activeImage = null,
dragDropDiv, dragDropDiv,
eventDiff_x = 0, eventDiff_x = 0,
eventDiff_y = 0, eventDiff_y = 0,
fileTypeRe = /^image\/(png|jpeg|gif)$/i, fileTypeRe = /^image\/(png|jpeg|gif|webp)$/i,
geckoOffsetX_marker = -3, geckoOffsetX_marker = -3,
geckoOffsetY_marker = -1, geckoOffsetY_marker = -1,
imageCompleted = 0, imageCompleted = 0,
@@ -434,7 +434,12 @@ function startUpload(list) {
function fileFilterError(file) { function fileFilterError(file) {
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" + alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
"gif, png, jpg 사진 파일만 전송할 수 있습니다."); "gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
}
function explorerFileFilterError(file) {
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
"익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다.");
} }
function imgComplete(img, imgSize, boxId) { function imgComplete(img, imgSize, boxId) {
@@ -962,7 +967,13 @@ DoUpload.prototype = {
file = files[i]; file = files[i];
if (!file.type.match(fileTypeRe)) { if (!file.type.match(fileTypeRe)) {
fileFilterError(file.name); // 엣지를 제외한 ie브라우저인지 체크
var agent = navigator.userAgent.toLowerCase();
if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) {
explorerFileFilterError(file.name);
} else {
FileFilterError(file.name);
}
continue; continue;
} }
this.list.push(file); this.list.push(file);
@@ -14,7 +14,7 @@ var activeImage = null,
dragDropDiv, dragDropDiv,
eventDiff_x = 0, eventDiff_x = 0,
eventDiff_y = 0, eventDiff_y = 0,
fileTypeRe = /^image\/(png|jpeg|gif)$/i, fileTypeRe = /^image\/(png|jpeg|gif|webp)$/i,
geckoOffsetX_marker = -3, geckoOffsetX_marker = -3,
geckoOffsetY_marker = -1, geckoOffsetY_marker = -1,
imageCompleted = 0, imageCompleted = 0,
@@ -434,7 +434,12 @@ function startUpload(list) {
function fileFilterError(file) { function fileFilterError(file) {
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" + alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
"gif, png, jpg 사진 파일만 전송할 수 있습니다."); "gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
}
function explorerFileFilterError(file) {
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
"익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다.");
} }
function imgComplete(img, imgSize, boxId) { function imgComplete(img, imgSize, boxId) {
@@ -962,7 +967,13 @@ DoUpload.prototype = {
file = files[i]; file = files[i];
if (!file.type.match(fileTypeRe)) { if (!file.type.match(fileTypeRe)) {
fileFilterError(file.name); // 엣지를 제외한 ie브라우저인지 체크
var agent = navigator.userAgent.toLowerCase();
if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) {
explorerFileFilterError(file.name);
} else {
FileFilterError(file.name);
}
continue; continue;
} }
this.list.push(file); this.list.push(file);
+1 -1
View File
@@ -335,7 +335,7 @@ function startUpload(count) {
function fileFilterError(file) { function fileFilterError(file) {
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" + alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
"gif, png, jpg, 그림 파일만 전송할 수 있습니다."); "gif, png, jpg, webp 그림 파일만 전송할 수 있습니다.");
} }
function imgComplete(img, imgSize, boxId) { function imgComplete(img, imgSize, boxId) {
@@ -54,7 +54,7 @@ function chkImgFormat (url)
{ {
var imageName = getFilename(url); var imageName = getFilename(url);
var allowSubmit = false; var allowSubmit = false;
var extArray = [".gif", ".jpg", ".jpeg", ".png"]; var extArray = [".gif", ".jpg", ".jpeg", ".png", ".webp"];
extArray.join(" "); extArray.join(" ");
if (imageName === "") { if (imageName === "") {
@@ -72,7 +72,7 @@ function chkImgFormat (url)
} }
if (!allowSubmit) { if (!allowSubmit) {
alert("사진은 GIF, JPG, PNG 형식만 넣을 수 있습니다."); alert("사진은 GIF, JPG, PNG, WEBP 형식만 넣을 수 있습니다.");
return false; return false;
} }
@@ -1,64 +1,67 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html lang="ko"> <html lang="ko">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>사진 첨부하기 :: SmartEditor2</title> <title>사진 첨부하기 :: SmartEditor2</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Generic page styles --> <!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css?v=140715"> <link rel="stylesheet" href="css/style.css?v=140715">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --> <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css"> <link rel="stylesheet" href="css/jquery.fileupload.css">
</head> </head>
<body> <body>
<div class="container pop_container"> <div class="container pop_container">
<!-- header --> <!-- header -->
<div id="pop_header"> <div id="pop_header">
<h1>사진 첨부하기</h1> <h1>사진 첨부하기</h1>
</div> </div>
<!-- //header --> <!-- //header -->
<div class="content_container"> <div class="content_container">
<div class="drag_explain"> <div class="drag_explain">
<p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p> <p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p>
<div class="file_selet_group"> <div class="file_selet_group">
<span class="btn btn-success fileinput-button"> <span class="btn btn-success fileinput-button">
<span>파일선택</span> <span>파일선택</span>
<!-- The file input field used as target for the file upload widget --> <!-- The file input field used as target for the file upload widget -->
<input id="fileupload" type="file" name="files[]" multiple accept="image/*"> <input id="fileupload" type="file" name="files[]" multiple accept="image/*">
</span> </span>
<button type="button" class="btn btn-danger delete" id="all_remove_btn"> <button type="button" class="btn btn-danger delete" id="all_remove_btn">
<span>전체삭제</span> <span>전체삭제</span>
</button> </button>
</div>
</div>
<div class="drag_area" id="drag_area">
<ul class="sortable" id="sortable">
</ul>
<em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
</div>
<div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
<div class="btn_group">
<button type="button" class="btn" id="img_upload_submit">
<span>등록</span>
</button>
<button type="button" class="btn" id="close_w_btn">
<span>취소</span>
</button>
</div> </div>
</div> </div>
<div class="drag_area" id="drag_area">
<ul class="sortable" id="sortable">
</ul>
<em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
</div>
<div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
<div class="btn_group">
<button type="button" class="btn" id="img_upload_submit">
<span>등록</span>
</button>
<button type="button" class="btn" id="close_w_btn" >
<span>취소</span>
</button>
</div>
</div> </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads --> <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="./js/jquery.iframe-transport.js"></script> <script src="./js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="./swfupload/swfupload.js"></script> <script type="text/javascript" src="./swfupload/swfupload.js?v=210625-1329"></script>
<script type="text/javascript" src="./swfupload/jquery.swfupload.js"></script> <script type="text/javascript" src="./swfupload/jquery.swfupload.js?v=210625-1329"></script>
<!-- The basic File Upload plugin --> <!-- The basic File Upload plugin -->
<script src="./js/jquery.fileupload.js?v=140715"></script> <script src="./js/jquery.fileupload.js?v=210625-1329"></script>
<script src="./js/basic.js?v3"></script> <script src="./js/basic.js?v=210625-1329"></script>
</body> </body>
</html> </html>
@@ -1,9 +1,9 @@
jQuery.fn.bindAll = function(options) { jQuery.fn.bindAll = function (options) {
var $this = this; var $this = this;
jQuery.each(options, function(key, val){ jQuery.each(options, function (key, val) {
$this.bind(key, val); $this.bind(key, val);
}); });
return this; return this;
} }
jQuery(function ($) { jQuery(function ($) {
@@ -11,131 +11,133 @@ jQuery(function ($) {
var ed_nonce = ''; var ed_nonce = '';
if( !!opener && !!opener.window && !!opener.window.nhn ){ if (!!opener && !!opener.window && !!opener.window.nhn) {
ed_nonce = opener.window.nhn.husky.SE2M_Configuration.SE2M_Accessibility.ed_nonce; ed_nonce = opener.window.nhn.husky.SE2M_Configuration.SE2M_Accessibility.ed_nonce;
} }
// Change this to the location of your server-side upload handler: // Change this to the location of your server-side upload handler:
var gnu = { var gnu = {
url : './php/?_nonce='+ed_nonce, url: './php/?_nonce=' + ed_nonce,
container_el : 'body', container_el: 'body',
dreg_area : '#drag_area', dreg_area: '#drag_area',
dreg_area_list : '#drag_area > ul', dreg_area_list: '#drag_area > ul',
progress_bar : '#progress .progress-bar', progress_bar: '#progress .progress-bar',
filter : /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png)$/i, filter: /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png|image\/webp)$/i,
files : [], files: [],
file_limit : 10, //한번에 올릴수 파일갯수 제한 file_limit: 10, //한번에 올릴수 파일갯수 제한
imgw : 100, imgw: 100,
imgh : 70, imgh: 70,
file_api_support : !!(window.ProgressEvent && window.FileReader), file_api_support: !!(window.ProgressEvent && window.FileReader),
$elTextGuide : $("#guide_text"), $elTextGuide: $("#guide_text"),
init : function(){ init: function () {
$(this.dreg_area_list).sortable({ $(this.dreg_area_list).sortable({
'cursor':'pointer', 'cursor': 'pointer',
'placeholder':'placeholder' 'placeholder': 'placeholder'
}); });
$(this.dreg_area_list).disableSelection(); $(this.dreg_area_list).disableSelection();
if( this.file_api_support ) this.$elTextGuide.removeClass("hidebg").addClass("showbg"); if (this.file_api_support) this.$elTextGuide.removeClass("hidebg").addClass("showbg");
}, },
file_push : function(file){ file_push: function (file) {
var othis = this, var othis = this,
last = othis.files.length; last = othis.files.length;
othis.files.push(file); othis.files.push(file);
}, },
_readymodebg : function(){ _readymodebg: function () {
if( this.file_api_support ) { if (this.file_api_support) {
var sClass = this.$elTextGuide.attr('class'); var sClass = this.$elTextGuide.attr('class');
if(sClass.indexOf('hidebg') > 0){ if (sClass.indexOf('hidebg') > 0) {
this.$elTextGuide.removeClass('hidebg'); this.$elTextGuide.removeClass('hidebg');
this.$elTextGuide.addClass('showbg'); this.$elTextGuide.addClass('showbg');
} }
} }
}, },
_startmodebg : function(){ _startmodebg: function () {
if( this.file_api_support ) { if (this.file_api_support) {
var sClass = this.$elTextGuide.attr('class'); var sClass = this.$elTextGuide.attr('class');
if(sClass.indexOf('hidebg') < 0){ if (sClass.indexOf('hidebg') < 0) {
this.$elTextGuide.removeClass('showbg'); this.$elTextGuide.removeClass('showbg');
this.$elTextGuide.addClass('hidebg'); this.$elTextGuide.addClass('hidebg');
} }
} }
}, },
_delete : function(e){ _delete: function (e) {
e.preventDefault(); e.preventDefault();
var othis = gnu, var othis = gnu,
$button = $(e.currentTarget), $button = $(e.currentTarget),
delete_url = $button.attr("data-delete"); delete_url = $button.attr("data-delete");
if( delete_url ){ if (delete_url) {
$.ajax({ $.ajax({
url: othis.url+"&del=1&file="+ delete_url url: othis.url + "&del=1&file=" + delete_url
}).done(function (result) { }).done(function (result) {
}); });
} }
$button.parents('li.sort_list').fadeOut(300, function(){ $button.parents('li.sort_list').fadeOut(300, function () {
$(this).remove(); $(this).remove();
var $dreg_area = $(othis.dreg_area_list); var $dreg_area = $(othis.dreg_area_list);
$dreg_area.sortable('refresh'); $dreg_area.sortable('refresh');
if( !$dreg_area.children('li').length ) othis._readymodebg(); if (!$dreg_area.children('li').length) othis._readymodebg();
}); });
}, },
_add : function(e, data, preload){ _add: function (e, data, preload) {
var othis = this; var othis = this;
othis._startmodebg(); othis._startmodebg();
data.context = $('<li/>').addClass("sort_list").appendTo(this.dreg_area_list); data.context = $('<li/>').addClass("sort_list").appendTo(this.dreg_area_list);
$.each(data.files, function (index, file) { $.each(data.files, function (index, file) {
if ( !preload && !othis.filter.test(file.type)) { if (!preload && !othis.filter.test(file.type)) {
var agent = navigator.userAgent.toLowerCase();
var msg = '';
msg = (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1)? "익스플로러 환경에서는 gif, png, jpg 파일만 \n전송할 수 있습니다.":"이미지만 허용합니다.";
data.context.remove(); data.context.remove();
alert('이미지만 허용합니다.'); alert(msg);
return true; return true;
} }
var node = $('<div/>') var node = $('<div/>')
.append($('<span/>').text(file.name)) .append($('<span/>').text(file.name))
.append($('<span/>').addClass("delete_img").attr({"data-delete":file.name,"data-url":file.url}).html("<img src='./img/system_delete.png' alt='삭제' title='삭제' >")), .append($('<span/>').addClass("delete_img").attr({ "data-delete": file.name, "data-url": file.url }).html("<img src='./img/system_delete.png' alt='삭제' title='삭제' >")),
$img = "<img src='./img/loading.gif' class='pre_thumb' />", $img = "<img src='./img/loading.gif' class='pre_thumb' />",
size_text = ''; size_text = '';
if ( preload && preload != 'swfupload' ){ if (preload && preload != 'swfupload') {
var ret = othis.get_ratio( file.width, file.height ), var ret = othis.get_ratio(file.width, file.height),
size_text = file.width+" x "+file.height; size_text = file.width + " x " + file.height;
$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' class='pre_thumb' />"; $img = "<img src='" + file.url + "' width='" + ret['width'] + "' height='" + ret['height'] + "' class='pre_thumb' />";
} }
if (!index) { if (!index) {
node node.prepend('<br>')
.prepend('<br>') .prepend($img);
.prepend($img); if (size_text) {
if(size_text){ node.append('<br>')
node.append('<br>')
.append($('<span/>').text(size_text)) .append($('<span/>').text(size_text))
}
} }
}
node.appendTo(data.context); node.appendTo(data.context);
node.find(".delete_img").on("click", othis._delete); node.find(".delete_img").on("click", othis._delete);
}); });
$(othis.dreg_area_list).sortable('refresh'); $(othis.dreg_area_list).sortable('refresh');
}, },
get_file_all : function(){ get_file_all: function () {
var othis = this, var othis = this,
oDate = new Date(); oDate = new Date();
$.ajax({ $.ajax({
// Uncomment the following to send cross-domain cookies: // Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true}, //xhrFields: {withCredentials: true},
//url: $('#fileupload').fileupload('option', 'url'), //url: $('#fileupload').fileupload('option', 'url'),
url: this.url+"&t="+ oDate.getTime(), url: this.url + "&t=" + oDate.getTime(),
dataType: 'json', dataType: 'json',
context: $('#fileupload')[0] context: $('#fileupload')[0]
}).always(function () { }).always(function () {
//$(this).removeClass('fileupload-processing'); //$(this).removeClass('fileupload-processing');
}).done(function (result) { }).done(function (result) {
$.each(result.files, function (index, data) { $.each(result.files, function (index, data) {
var tmp = { files : [] }; var tmp = { files: [] };
tmp.files[0] = data; tmp.files[0] = data;
othis._add( $.Event('add'), tmp, 'preload' ); othis._add($.Event('add'), tmp, 'preload');
}); });
}); });
}, },
_processalways : function(e, data){ _processalways: function (e, data) {
var index = data.index, var index = data.index,
file = data.files[index], file = data.files[index],
node = $(data.context.children()[index]); node = $(data.context.children()[index]);
@@ -150,29 +152,29 @@ jQuery(function ($) {
.prop('disabled', !!data.files.error); .prop('disabled', !!data.files.error);
} }
}, },
obj_to_arr : function(obj){ obj_to_arr: function (obj) {
var array = $.map(obj, function(value, index) { var array = $.map(obj, function (value, index) {
return [value]; return [value];
}); });
return array; return array;
}, },
_done : function(e, data){ _done: function (e, data) {
var othis = this; var othis = this;
$.each(data.result.files, function (index, file) { $.each(data.result.files, function (index, file) {
if (file.url && !file.error) { if (file.url && !file.error) {
var ret = othis.get_ratio( file.width, file.height ), var ret = othis.get_ratio(file.width, file.height),
node = $(data.context.children()[index]), node = $(data.context.children()[index]),
size_text = file.width+" x "+file.height, size_text = file.width + " x " + file.height,
//$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' />", //$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' />",
link = $('<a>') link = $('<a>')
.attr('target', '_blank') .attr('target', '_blank')
.prop('href', file.url); .prop('href', file.url);
node node
//.wrap(link) //.wrap(link)
.append('<br>') .append('<br>')
.append($('<span/>').text(size_text)) .append($('<span/>').text(size_text))
.find("img.pre_thumb").attr({"src":file.url,"width":ret['width'],"height":ret['height']}) .find("img.pre_thumb").attr({ "src": file.url, "width": ret['width'], "height": ret['height'] })
.end().find(".delete_img").attr({"data-delete":file.name,"data-url":file.url}); .end().find(".delete_img").attr({ "data-delete": file.name, "data-url": file.url });
} else if (file.error) { } else if (file.error) {
var error = $('<span class="text-danger"/>').text(file.error); var error = $('<span class="text-danger"/>').text(file.error);
$(data.context.children()[index]) $(data.context.children()[index])
@@ -182,20 +184,20 @@ jQuery(function ($) {
othis.file_push(file); othis.file_push(file);
}); });
}, },
get_ratio : function(width, height){ get_ratio: function (width, height) {
var ratio = 0, var ratio = 0,
ret_img = []; ret_img = [];
if( !width || !height ){ if (!width || !height) {
ret_img['width'] = this.imgw; ret_img['width'] = this.imgw;
ret_img['height'] = this.imgh; ret_img['height'] = this.imgh;
return ret_img; return ret_img;
} }
if(width > this.imgw){ if (width > this.imgw) {
ratio = this.imgw / width; ratio = this.imgw / width;
height = height * ratio; height = height * ratio;
width = this.imgw; width = this.imgw;
} }
if( height > this.imgh ){ if (height > this.imgh) {
ratio = this.imgh / height; ratio = this.imgh / height;
width = width * ratio; width = width * ratio;
height = this.imgh; height = this.imgh;
@@ -204,7 +206,7 @@ jQuery(function ($) {
ret_img['height'] = parseInt(height); ret_img['height'] = parseInt(height);
return ret_img; return ret_img;
}, },
setPhotoToEditor : function(oFileInfo){ setPhotoToEditor: function (oFileInfo) {
if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) { if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) {
//스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array) //스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array)
opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]); opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]);
@@ -221,19 +223,19 @@ jQuery(function ($) {
dropZone: $(gnu.dreg_area), dropZone: $(gnu.dreg_area),
autoUpload: true, autoUpload: true,
sequentialUploads: true, sequentialUploads: true,
acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png)$/i, acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png|webp)$/i,
// Enable image resizing, except for Android and Opera, // Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to // which actually support image resizing, but fail to
// send Blob objects via XHR requests: // send Blob objects via XHR requests:
disableImageResize: true, disableImageResize: true,
limit_filesLength : gnu.file_limit limit_filesLength: gnu.file_limit
}).on('fileuploadadd', function (e, data) { }).on('fileuploadadd', function (e, data) {
gnu._add(e, data); gnu._add(e, data);
}).on('fileuploadprocessalways', function (e, data) { }).on('fileuploadprocessalways', function (e, data) {
gnu._processalways(e, data); gnu._processalways(e, data);
}).on('fileuploaddone', function (e, data) { }).on('fileuploaddone', function (e, data) {
gnu._done( e, data ); gnu._done(e, data);
}).on('fileuploadfail', function (e, data) { }).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index, file) { $.each(data.files, function (index, file) {
@@ -247,85 +249,84 @@ jQuery(function ($) {
gnu.init(); gnu.init();
var listeners = { var listeners = {
data : {}, data: {},
log : false, log: false,
swfuploadLoaded: function(event){ swfuploadLoaded: function (event) {
if(this.log) $('.log', this).append('<li>Loaded</li>'); if (this.log) $('.log', this).append('<li>Loaded</li>');
}, },
fileQueued: function(event, file){ fileQueued: function (event, file) {
if(this.log) $('.log', this).append('<li>File queued - '+file.name+'</li>'); if (this.log) $('.log', this).append('<li>File queued - ' + file.name + '</li>');
// start the upload once it is queued // start the upload once it is queued
// but only if this queue is not disabled // but only if this queue is not disabled
if (!$('input[name=disabled]:checked', this).length) { if (!$('input[name=disabled]:checked', this).length) {
$(this).swfupload('startUpload'); $(this).swfupload('startUpload');
} }
}, },
fileQueueError: function(event, file, errorCode, message){ fileQueueError: function (event, file, errorCode, message) {
switch (errorCode) switch (errorCode) {
{ case -100:
case -100 : alert("파일을 " + message + "개 이하로 선택해주세요.");
alert("파일을 "+message+"개 이하로 선택해주세요.");
break; break;
} }
if(this.log) $('.log', this).append('<li>File queue error - '+message+'</li>'); if (this.log) $('.log', this).append('<li>File queue error - ' + message + '</li>');
}, },
fileDialogStart: function(event){ fileDialogStart: function (event) {
if(this.log) $('.log', this).append('<li>File dialog start</li>'); if (this.log) $('.log', this).append('<li>File dialog start</li>');
}, },
fileDialogComplete: function(event, numFilesSelected, numFilesQueued){ fileDialogComplete: function (event, numFilesSelected, numFilesQueued) {
if(this.log) $('.log', this).append('<li>File dialog complete</li>'); if (this.log) $('.log', this).append('<li>File dialog complete</li>');
}, },
uploadStart: function(event, file){ uploadStart: function (event, file) {
listeners.data.files = $.makeArray(file); listeners.data.files = $.makeArray(file);
gnu._add( event, listeners.data, 'swfupload' ); gnu._add(event, listeners.data, 'swfupload');
if(this.log) $('.log', this).append('<li>Upload start - '+file.name+'</li>'); if (this.log) $('.log', this).append('<li>Upload start - ' + file.name + '</li>');
}, },
uploadProgress: function(event, file, bytesLoaded){ uploadProgress: function (event, file, bytesLoaded) {
if(this.log) $('.log', this).append('<li>Upload progress - '+bytesLoaded+'</li>'); if (this.log) $('.log', this).append('<li>Upload progress - ' + bytesLoaded + '</li>');
}, },
uploadSuccess: function(event, file, serverData){ uploadSuccess: function (event, file, serverData) {
listeners.data.result = jQuery.parseJSON( serverData ); listeners.data.result = jQuery.parseJSON(serverData);
gnu._done( event, listeners.data ); gnu._done(event, listeners.data);
if(this.log) $('.log', this).append('<li>Upload success - '+file.name+'</li>'); if (this.log) $('.log', this).append('<li>Upload success - ' + file.name + '</li>');
}, },
uploadComplete: function(event, file){ uploadComplete: function (event, file) {
if(this.log) $('.log', this).append('<li>Upload complete - '+file.name+'</li>'); if (this.log) $('.log', this).append('<li>Upload complete - ' + file.name + '</li>');
// upload has completed, lets try the next one in the queue // upload has completed, lets try the next one in the queue
// but only if this queue is not disabled // but only if this queue is not disabled
if (!$('input[name=disabled]:checked', this).length) { if (!$('input[name=disabled]:checked', this).length) {
$(this).swfupload('startUpload'); $(this).swfupload('startUpload');
} }
}, },
uploadError: function(event, file, errorCode, message){ uploadError: function (event, file, errorCode, message) {
if(this.log) $('.log', this).append('<li>Upload error - '+message+'</li>'); if (this.log) $('.log', this).append('<li>Upload error - ' + message + '</li>');
} }
}; };
$(gnu.container_el).bindAll(listeners); $(gnu.container_el).bindAll(listeners);
/* listeners이벤트 */ /* listeners이벤트 */
$(gnu.dreg_area).bind('drop dragover', function (e) { $(gnu.dreg_area).bind('drop dragover', function (e) {
e.preventDefault(); e.preventDefault();
if( !gnu.file_api_support && e.type == 'drop' ) alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다."); if (!gnu.file_api_support && e.type == 'drop') alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다.");
}); });
$("#all_remove_btn").bind("click", function(e){ $("#all_remove_btn").bind("click", function (e) {
e.preventDefault(); e.preventDefault();
if( $(gnu.dreg_area_list).children().length ){ if ($(gnu.dreg_area_list).children().length) {
if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")){ if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")) {
$(gnu.dreg_area_list).find(".delete_img").each( function(i){ $(gnu.dreg_area_list).find(".delete_img").each(function (i) {
$(this).trigger("click"); $(this).trigger("click");
}); });
$(gnu.dreg_area_list).sortable('refresh'); $(gnu.dreg_area_list).sortable('refresh');
} }
} }
}); });
$("#img_upload_submit").bind("click", function(e){ $("#img_upload_submit").bind("click", function (e) {
e.preventDefault(); e.preventDefault();
var aResult = [], j = 0; var aResult = [], j = 0;
$(gnu.dreg_area_list).find(".delete_img").each( function(i, f){ $(gnu.dreg_area_list).find(".delete_img").each(function (i, f) {
if( !$(this).attr("data-url") ) return true; if (!$(this).attr("data-url")) return true;
aResult[j] = []; aResult[j] = [];
aResult[j]['bNewLine'] = 'true'; aResult[j]['bNewLine'] = 'true';
aResult[j]['sAlign'] = ''; aResult[j]['sAlign'] = '';
@@ -333,13 +334,13 @@ jQuery(function ($) {
aResult[j]['sFileURL'] = $(this).attr("data-url"); aResult[j]['sFileURL'] = $(this).attr("data-url");
j++; j++;
}); });
if( aResult.length ){ if (aResult.length) {
gnu.setPhotoToEditor(aResult); gnu.setPhotoToEditor(aResult);
aResult = null; aResult = null;
} }
window.close(); window.close();
}); });
$("#close_w_btn").bind("click", function(e){ $("#close_w_btn").bind("click", function (e) {
e.preventDefault(); e.preventDefault();
window.close(); window.close();
}); });
@@ -1283,8 +1283,8 @@
file_size_limit : "10 MB", file_size_limit : "10 MB",
file_upload_limit: 0, file_upload_limit: 0,
file_queue_limit : this.options.limit_filesLength, file_queue_limit : this.options.limit_filesLength,
file_types : "*.jpeg; *.bmp; *.png; *.jpg; *.gif", file_types : "*.jpeg; *.bmp; *.png; *.jpg; *.gif; *.webp",
file_types_description : "Image Files (JPG, JPEG, PNG, BMP, GIF)", file_types_description : "Image Files (JPG, JPEG, PNG, BMP, GIF, WEBP)",
flash_url : "./swfupload/swfupload.swf", flash_url : "./swfupload/swfupload.swf",
button_placeholder : this.options.fileInput[0], button_placeholder : this.options.fileInput[0],
button_width : "100%", button_width : "100%",
@@ -26,6 +26,7 @@ class UploadHandler
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/png" => array("imagecreatefrompng", "imagepng"), "image/png" => array("imagecreatefrompng", "imagepng"),
"image/webp" => array("imagecreatefromwebp", "imagewebp"),
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp") "image/bmp" => array("imagecreatefromwbmp", "imagewbmp")
); );
@@ -93,10 +94,10 @@ class UploadHandler
// is enabled, set to 0 to disable chunked reading of files: // is enabled, set to 0 to disable chunked reading of files:
'readfile_chunk_size' => 10 * 1024 * 1024, // 10 MiB 'readfile_chunk_size' => 10 * 1024 * 1024, // 10 MiB
// Defines which files can be displayed inline when downloaded: // Defines which files can be displayed inline when downloaded:
'inline_file_types' => '/\.(gif|jpe?g|bmp|png)$/i', 'inline_file_types' => '/\.(gif|jpe?g|bmp|png|webp)$/i',
// Defines which files (based on their names) are accepted for upload: // Defines which files (based on their names) are accepted for upload:
//'accept_file_types' => '/.+$/i', //'accept_file_types' => '/.+$/i',
'accept_file_types' => '/\.(gif|jpe?g|bmp|png)$/i', 'accept_file_types' => '/\.(gif|jpe?g|bmp|png|webp)$/i',
// The php.ini settings upload_max_filesize and post_max_size // The php.ini settings upload_max_filesize and post_max_size
// take precedence over the following max_file_size setting: // take precedence over the following max_file_size setting:
'max_file_size' => null, 'max_file_size' => null,
@@ -104,7 +105,7 @@ class UploadHandler
// The maximum number of files for the upload directory: // The maximum number of files for the upload directory:
'max_number_of_files' => null, 'max_number_of_files' => null,
// Defines which files are handled as image files: // Defines which files are handled as image files:
'image_file_types' => '/\.(gif|jpe?g|bmp|png)$/i', 'image_file_types' => '/\.(gif|jpe?g|bmp|png|webp)$/i',
'is_resize' => (defined('SMARTEDITOR_UPLOAD_RESIZE') && SMARTEDITOR_UPLOAD_RESIZE) ? true : false, 'is_resize' => (defined('SMARTEDITOR_UPLOAD_RESIZE') && SMARTEDITOR_UPLOAD_RESIZE) ? true : false,
'resize_max_width' => (defined('SMARTEDITOR_UPLOAD_MAX_WIDTH') && SMARTEDITOR_UPLOAD_MAX_WIDTH) ? SMARTEDITOR_UPLOAD_MAX_WIDTH : 800, 'resize_max_width' => (defined('SMARTEDITOR_UPLOAD_MAX_WIDTH') && SMARTEDITOR_UPLOAD_MAX_WIDTH) ? SMARTEDITOR_UPLOAD_MAX_WIDTH : 800,
'resize_max_height' => (defined('SMARTEDITOR_UPLOAD_MAX_HEIGHT') && SMARTEDITOR_UPLOAD_MAX_HEIGHT) ? SMARTEDITOR_UPLOAD_MAX_HEIGHT : 800, 'resize_max_height' => (defined('SMARTEDITOR_UPLOAD_MAX_HEIGHT') && SMARTEDITOR_UPLOAD_MAX_HEIGHT) ? SMARTEDITOR_UPLOAD_MAX_HEIGHT : 800,
@@ -498,7 +499,7 @@ class UploadHandler
} }
// Add missing file extension for known image types: // Add missing file extension for known image types:
if (strpos($name, '.') === false && if (strpos($name, '.') === false &&
preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) { preg_match('/^image\/(gif|jpe?g|png|webp)/', $type, $matches)) {
$name .= '.'.$matches[1]; $name .= '.'.$matches[1];
} }
if (function_exists('exif_imagetype') && $file_path) { if (function_exists('exif_imagetype') && $file_path) {
@@ -512,6 +513,9 @@ class UploadHandler
case IMAGETYPE_GIF: case IMAGETYPE_GIF:
$extensions = array('gif'); $extensions = array('gif');
break; break;
case IMAGETYPE_WEBP:
$extensions = array('webp');
break;
} }
// Adjust incorrect image file extensions: // Adjust incorrect image file extensions:
if (!empty($extensions)) { if (!empty($extensions)) {
@@ -688,7 +692,7 @@ class UploadHandler
$src_func = 'imagecreatefromjpeg'; $src_func = 'imagecreatefromjpeg';
$write_func = 'imagejpeg'; $write_func = 'imagejpeg';
$image_quality = isset($options['jpeg_quality']) ? $image_quality = isset($options['jpeg_quality']) ?
$options['jpeg_quality'] : 75; $options['jpeg_quality'] : 75;
break; break;
case 'gif': case 'gif':
$src_func = 'imagecreatefromgif'; $src_func = 'imagecreatefromgif';
@@ -699,7 +703,12 @@ class UploadHandler
$src_func = 'imagecreatefrompng'; $src_func = 'imagecreatefrompng';
$write_func = 'imagepng'; $write_func = 'imagepng';
$image_quality = isset($options['png_quality']) ? $image_quality = isset($options['png_quality']) ?
$options['png_quality'] : 9; $options['png_quality'] : 9;
break;
case 'webp':
$src_func = 'imagecreatefromwebp';
$write_func = 'imagewebp';
$image_quality = null;
break; break;
default: default:
return false; return false;
@@ -1087,7 +1096,12 @@ class UploadHandler
$image_from_file = self::$MIME_TYPES_PROCESSORS[$mime_type][0]; $image_from_file = self::$MIME_TYPES_PROCESSORS[$mime_type][0];
$image_to_file = self::$MIME_TYPES_PROCESSORS[$mime_type][1]; $image_to_file = self::$MIME_TYPES_PROCESSORS[$mime_type][1];
// webp 의 경우 gd-webp cannot allocate temporary buffer 오류가 발생하여 webp 이미지가 업로드 되지 않을 수 있음
// $reprocessed_image = imagecreatefromwebp($file_path); 이 코드로 웹서버의 error_log 에서 확인해 볼 수 있음
// https://stackoverflow.com/questions/61394477/php-e-error-gd-webp-cannot-allocate-temporary-buffer
// 움직이는 webp 이미지나 큰사이즈의 webp 이미지에 대한 해결 방안은 아직 없는 것 같다
$reprocessed_image = @$image_from_file($file_path); $reprocessed_image = @$image_from_file($file_path);
// error_log("\$image_from_file = '$image_from_file', \$image_to_file = '$image_to_file', \$reprocessed_image = '$reprocessed_image', \$file_path ='$file_path' ");
if (!$reprocessed_image) { if (!$reprocessed_image) {
//throw new Exception("Unable to create reprocessed image from file"); //throw new Exception("Unable to create reprocessed image from file");
@@ -1288,6 +1302,8 @@ class UploadHandler
return 'image/png'; return 'image/png';
case 'gif': case 'gif':
return 'image/gif'; return 'image/gif';
case 'webp':
return 'image/webp';
default: default:
return ''; return '';
} }
@@ -287,7 +287,7 @@ function preview(thumb) {
var thumb = file.bf_file; var thumb = file.bf_file;
} }
var pattern = /\.(jpg|png|gif)$/i; var pattern = /\.(jpg|png|gif|webp)$/i;
if (pattern.test(thumb)) { if (pattern.test(thumb)) {
var thumb_kind = "img"; var thumb_kind = "img";
} else { } else {
@@ -321,7 +321,7 @@ function file_to_editor() {
var file = get_file_info(files_list.options[i].value); var file = get_file_info(files_list.options[i].value);
var path = board_file_path + '/' + file.bf_file; var path = board_file_path + '/' + file.bf_file;
var pattern = /\.(jpg|png|gif)$/i; var pattern = /\.(jpg|png|gif|webp)$/i;
if (pattern.test(file.bf_file)) { if (pattern.test(file.bf_file)) {
if (wr_id) { if (wr_id) {
html = "{이미지:" + file.bf_no + "}"; html = "{이미지:" + file.bf_no + "}";
+2 -2
View File
@@ -131,10 +131,10 @@ class Hybrid_Providers_Naver extends Hybrid_Provider_Model_OAuth2
if( array_key_exists('birthday',$data) ){ if( array_key_exists('birthday',$data) ){
$tmp = explode("-",$data['birthday']); $tmp = explode("-",$data['birthday']);
if( isset($tmp[0]) ){ if( isset($tmp[0]) ){
$this->user->profile->birthDay = $tmp[0]; $this->user->profile->birthMonth = $tmp[0];
} }
if( isset($tmp[1]) ){ if( isset($tmp[1]) ){
$this->user->profile->birthMonth = $tmp[1]; $this->user->profile->birthDay = $tmp[1];
} }
} }
$this->user->profile->email = (array_key_exists('email',$data))?$data['email']:""; $this->user->profile->email = (array_key_exists('email',$data))?$data['email']:"";
+1 -1
View File
@@ -23,7 +23,7 @@ if( isset( $_REQUEST["redirect_to_idp"] ) ){
$get_login_url = G5_BBS_URL."/login.php?url=".$urlencode; $get_login_url = G5_BBS_URL."/login.php?url=".$urlencode;
if( $content ){ if( $content ){
//팝업으로 뜨웠다면 아래 //팝업으로 띄웠다면 아래 코드를 실행
?> ?>
<script> <script>
if( window.opener ){ if( window.opener ){
+3 -1
View File
@@ -74,7 +74,9 @@ if($act == "buy")
and ct_status = '쇼핑' and ct_status = '쇼핑'
and ct_select = '1' "; and ct_select = '1' ";
$sum = sql_fetch($sql); $sum = sql_fetch($sql);
$sum_qty = $sum['cnt']; // $sum['cnt'] 가 null 일때 재고 반영이 제대로 안되는 오류 수정 (그누위즈님,210614)
// $sum_qty = $sum['cnt'];
$sum_qty = is_int($sum['cnt']) ? $sum['cnt'] : 0;
// 재고 구함 // 재고 구함
$ct_qty = $row['ct_qty']; $ct_qty = $row['ct_qty'];
+2
View File
@@ -35,7 +35,9 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
<?php if(G5_COMMUNITY_USE) { ?> <?php if(G5_COMMUNITY_USE) { ?>
<ul id="hd_define"> <ul id="hd_define">
<li class="active"><a href="<?php echo G5_URL ?>/">커뮤니티</a></li> <li class="active"><a href="<?php echo G5_URL ?>/">커뮤니티</a></li>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li><a href="<?php echo G5_SHOP_URL ?>/">쇼핑몰</a></li> <li><a href="<?php echo G5_SHOP_URL ?>/">쇼핑몰</a></li>
<?php } ?>
</ul> </ul>
<?php } ?> <?php } ?>
<ul id="hd_qnb"> <ul id="hd_qnb">
+2
View File
@@ -68,8 +68,10 @@ var g5_bo_table = "<?php echo isset($bo_table)?$bo_table:''; ?>";
var g5_sca = "<?php echo isset($sca)?$sca:''; ?>"; var g5_sca = "<?php echo isset($sca)?$sca:''; ?>";
var g5_editor = "<?php echo ($config['cf_editor'] && $board['bo_use_dhtml_editor'])?$config['cf_editor']:''; ?>"; var g5_editor = "<?php echo ($config['cf_editor'] && $board['bo_use_dhtml_editor'])?$config['cf_editor']:''; ?>";
var g5_cookie_domain = "<?php echo G5_COOKIE_DOMAIN ?>"; var g5_cookie_domain = "<?php echo G5_COOKIE_DOMAIN ?>";
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
var g5_theme_shop_url = "<?php echo G5_THEME_SHOP_URL; ?>"; var g5_theme_shop_url = "<?php echo G5_THEME_SHOP_URL; ?>";
var g5_shop_url = "<?php echo G5_SHOP_URL; ?>"; var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
<?php } ?>
<?php if(defined('G5_IS_ADMIN')) { ?> <?php if(defined('G5_IS_ADMIN')) { ?>
var g5_admin_url = "<?php echo G5_ADMIN_URL; ?>"; var g5_admin_url = "<?php echo G5_ADMIN_URL; ?>";
<?php } ?> <?php } ?>
+2
View File
@@ -69,7 +69,9 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
if ($i == 0) { ?> if ($i == 0) { ?>
<li id="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하세요.<?php } ?></li> <li id="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하세요.<?php } ?></li>
<?php } ?> <?php } ?>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li class="gnb_1dli"><a href="<?php echo G5_SHOP_URL ?>" class="gnb_1da"> 쇼핑몰</a></li> <li class="gnb_1dli"><a href="<?php echo G5_SHOP_URL ?>" class="gnb_1da"> 쇼핑몰</a></li>
<?php } ?>
</ul> </ul>
<ul id="hd_nb"> <ul id="hd_nb">