Compare commits

...
63 Commits
Author SHA1 Message Date
thisgun 29381da2ce 버전 5.6.7 수정 2024-10-31 16:19:11 +09:00
thisgun d96f47f93d NHN_KCP 휴대폰 본인인증 설정 가맹점 인증키 추가 2024-10-31 12:17:26 +09:00
thisgun 830994b637 소셜로그인 테이블 PK 수정 2024-10-28 10:55:14 +09:00
thisgun 0d586e2101 htmlpurifier 4.15.0 버전으로 수정 2024-10-25 17:52:55 +09:00
thisgun 5e6549a22c 영카트 관리자페이지 주문내역출력 페이지 코드 수정 2024-10-25 16:25:54 +09:00
thisgun ab204cfa59 CloudFlare 환경과 적용에 대한 코드 수정 #349 2024-10-25 11:46:50 +09:00
thisgun 3ca77a38fb 위시리스트에서 주문하기시 상품이 잘못 장바구니 담기되는 오류 수정 2024-10-23 15:23:47 +09:00
thisgun 67051c74a8 latest 함수 PHP 8 optional parameter issue 수정 2024-10-22 17:48:08 +09:00
thisgun 2a0bf12e65 버전 5.6.6 수정 2024-09-24 16:05:45 +09:00
thisgun dfa16adf31 KG이니시스 통합인증 9032 중복된 주문 에러와 회원정보 찾기 오류 수정 2024-09-24 16:03:42 +09:00
thisgun 96b30e0df6 Toss Payments - XPay 호출 도메인 변경 lgdacom.conf url 수정 #341 2024-09-04 20:03:13 +09:00
thisgun ef99a886cc 버전 5.6.5 수정 2024-09-04 12:56:35 +09:00
thisgun 20eb993757 나이스페이 주문정보 입력 오류시 결제 취소 코드 추가 및 불필요한 코드 제거 2024-09-04 12:55:05 +09:00
thisgun 3474be175d 토스페이먼츠 (구)lg XPay 테스트 에스크로 배송 url 수정 2024-09-03 18:03:21 +09:00
thisgun 532bf6f0f4 토스페이먼츠 (구)lg XPay 도메인 지원종료에 따른 결제도메인 수정 2024-09-03 17:17:55 +09:00
thisgun c4c1e50f68 Merge branch 'master' of github.com:gnuboard/gnuboard5 2024-07-18 10:28:57 +09:00
thisgun 7754e12194 토스페이먼츠 테스트 결제 url 수정 2024-07-18 10:28:26 +09:00
thisgun 287d68790f 토스페이먼츠 모바일 결제수단 키 수정 2024-07-18 10:18:57 +09:00
kaglaandGitHub 7d396b1749 Merge pull request #331 from gnuboard/php8.3
창고재고 없을때 '재고 부족' sound 처리하는 잘못 노출된 span 태그 제거
2024-07-18 08:24:17 +09:00
kagla d666e3467f 창고재고 없을때 '재고 부족' sound 처리하는 잘못 노출된 span 태그 제거 2024-07-18 08:18:11 +09:00
kagla d4c158cfa4 php-mysql 미설치시, 그누보드 설치 경고창에 정보 안나오는 경우 해결 2024-07-16 10:56:06 +09:00
thisgun f1af936c7d Cloudflare 환경에서 REMOTE_ADDR에 사용자 아이피 적용 2024-07-11 18:30:03 +09:00
thisgun 72d52b594c Deprecated: Optional parameter warning message 경고메시지 나오는 함수 코드 수정 2024-07-08 11:22:58 +09:00
thisgun 5622b38c17 버전 5.6.4 수정 2024-07-03 12:59:54 +09:00
thisgun cef3a48ff1 Merge branch 'master' of github.com:gnuboard/gnuboard5 2024-07-03 12:50:21 +09:00
thisgun c6b58bb16b 그누보드 open redirect 취약점 수정 2024-07-03 12:50:12 +09:00
thisgun 14ffe72574 영카트 관리자 주문내역에서 개인결제 추가시 토큰오류 문제 수정 2024-07-03 11:56:33 +09:00
kkigomiandGitHub 02baf1589f fix: get_member 함수에서 hook에 잘못된 아이디가 전달될 수 있는 문제 고침 (#328)
* fix: get_member 함수에서 hook에 잘못된 아이디가 전달될 수 있는 문제 고침

trim()이 mysql 쿼리에서만 처리되어 hook에 잘못된 회원아이디가 전달될 수 있는 문제.

* 잘못된 파라미터 타입 수정
2024-06-18 09:45:34 +09:00
thisgun 9a1067862a 버전 5.6.3 수정 2024-06-07 14:28:31 +09:00
thisgun 07f848e1c7 Merge branch 'master' of github.com:gnuboard/gnuboard5 2024-06-07 12:43:59 +09:00
thisgun 80846ac637 5.5버전 브랜치와 충돌수정 2024-06-07 12:43:34 +09:00
thisgun 62c0803cf5 초기화되지 않은 변수 수정 #325 2024-06-07 12:38:32 +09:00
thisgun 08df872863 HTMLPurifier_Filter_iframevideo 클래스명의 대소문자 불일치 수정#324 2024-06-07 12:31:17 +09:00
zipuragiandGitHub ca30e27b27 게시판에서 회원 아이디로 댓글 검색시 잘못된 결과가 나오는 문제 (#322) 2024-06-07 12:25:31 +09:00
thisgun 56615a5e9e 비회원인 상태에서 장바구니에서 주문하기 후 로그인하면 장바구니가 비어있는 문제 수정 2024-06-07 12:24:41 +09:00
총andGitHub 9c44d234ed Create SECURITY.md 2024-06-05 16:18:50 +09:00
thisgun e03e01d410 Open Redirect 취약점 수정 #318 2024-06-05 14:56:50 +09:00
thisgun 940e701fa4 관리자 회원관리에서 PHP WARNING 경고문이 나오는 코드 수정 #316 2024-06-05 10:09:24 +09:00
thisgun 031f8b4ef9 소셜로그인 타임아웃 설정타임 수정 #315 2024-06-04 17:59:31 +09:00
thisgun ed6b7f3326 글쓰기 임시저장과 쪽지쓰기 코드 수정 2024-06-04 17:38:33 +09:00
thisgun 0ded1df66d 삼품재고관리가 제대로 표시되지 않는 문제 수정 2024-06-04 11:27:16 +09:00
thisgun f4dfbacf03 글복사 sql query에 볋칭 as 추가 및 포인트 업데이트 코드 수정 2024-06-04 10:25:59 +09:00
thisgun 3fd8740c92 관리자 기본환경설정에서 불필요한 코드 제거 2024-06-03 18:16:59 +09:00
thisgun 68dc0bd4ec KG이니시스 MID SEED대칭키 수정 2024-06-03 18:16:17 +09:00
thisgun cc96048dfa NHN_KCP 결제정보 검증기능 추가 적용 2024-06-03 18:15:45 +09:00
thisgun 6697327265 쇼핑몰 주문 SMS 파일의 금액변수에 (int) 형 추가 2024-06-03 18:15:39 +09:00
thisgun a301d3e1f0 관리자 기본환경설정에서 불필요한 코드 제거 2024-06-03 12:39:48 +09:00
thisgun 2c0e05bbcc KG이니시스 MID SEED대칭키 수정 2024-05-31 19:23:42 +09:00
thisgun 92c1052cf5 NHN_KCP 결제정보 검증기능 추가 적용 2024-05-14 17:10:00 +09:00
thisgun c4763a64d8 쇼핑몰 주문 SMS 파일의 금액변수에 (int) 형 추가 2024-05-14 16:04:14 +09:00
kit rioandthisgun 02e0996eb4 kisa seed_cbc undefined 변수 수정
SEED_CBC_Decrypt 함수
return null 전에 초기화
2024-04-17 18:41:44 +09:00
thisgun 82648dcbfc 버전 5.6.2 수정 2024-04-17 18:29:23 +09:00
thisgun 61a0236938 버전 5.5.16 수정 2024-04-17 18:23:10 +09:00
thisgun 712172a0ea NHN_KCP 결제정보 검증기능 적용 2024-04-17 18:19:43 +09:00
thisgun d0eadcb12e 나이스페이 관리자 테스트결제 경고문 표시 및 모바일결제 스크립트 오류 수정 2024-04-17 15:45:36 +09:00
thisgun f38baea729 Merge branch 'master' of github.com:gnuboard/g5-update 2024-04-17 15:22:12 +09:00
thisgun 6048a8a1c5 NHN_KCP 결제정보 검증기능 적용 2024-04-17 15:21:55 +09:00
총andGitHub b84a6114f4 Merge pull request #12 from gnuboard/fix/cbc
seed_cbc undefined 변수 수정
2024-04-12 16:09:56 +09:00
kit rio b3ea5f19a8 kisa seed_cbc undefined 변수 수정
SEED_CBC_Decrypt 함수
return null 전에 초기화
2024-04-11 17:46:58 +09:00
thisgun b52a1f4da4 버전 5.6.1 수정 2024-04-11 12:32:58 +09:00
thisgun ce89cba2c7 버전 5.5.15 수정 2024-04-11 12:14:00 +09:00
thisgun c3634c05f7 KG이니시스 통합인증 암호화적용 여부 선택옵션 추가 2024-04-11 12:10:59 +09:00
thisgun 470d65d92a KG이니시스 통합인증 암호화적용 여부 선택옵션 추가 2024-04-11 11:55:55 +09:00
71 changed files with 28863 additions and 28506 deletions
+3
View File
@@ -0,0 +1,3 @@
# Gnuboard5 Security Policy
Please ask [https://sir.kr/security/.](https://sir.kr/co_qa)
+28
View File
@@ -409,6 +409,17 @@ if (!isset($config['cf_cert_kg_mid'])) {
ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; "; ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; ";
sql_query($sql, false); sql_query($sql, false);
} }
if (!isset($config['cf_cert_use_seed'])) {
$sql = "ALTER TABLE `{$g5['config_table']}`
ADD COLUMN `cf_cert_use_seed` TINYINT(4) NOT NULL DEFAULT '1' AFTER `cf_cert_kg_mid`; ";
sql_query($sql, false);
}
if (!isset($config['cf_cert_kcp_enckey'])) {
$sql = "ALTER TABLE `{$g5['config_table']}`
ADD COLUMN `cf_cert_kcp_enckey` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`; ";
sql_query($sql, false);
}
if (!$config['cf_faq_skin']) { if (!$config['cf_faq_skin']) {
$config['cf_faq_skin'] = "basic"; $config['cf_faq_skin'] = "basic";
} }
@@ -1003,6 +1014,16 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_use_seed">통합인증 암호화 적용</label></th>
<td class="cf_cert_service">
<?php echo help('KG이니시스 통합인증서비스에 암호화를 적용합니다. 만일 글자가 깨지는 문제가 발생하면 사용안함으로 적용해 주세요.') ?>
<select name="cf_cert_use_seed" id="cf_cert_use_seed">
<?php echo option_selected("0", $config['cf_cert_use_seed'], "사용안함"); ?>
<?php echo option_selected("1", $config['cf_cert_use_seed'], "사용함"); ?>
</select>
</td>
</tr>
<tr> <tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_hp">휴대폰 본인확인</label></th> <th scope="row" class="cf_cert_service"><label for="cf_cert_hp">휴대폰 본인확인</label></th>
<td class="cf_cert_service"> <td class="cf_cert_service">
@@ -1051,6 +1072,13 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<input type="text" name="cf_cert_kcp_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcp_cd']); ?>" id="cf_cert_kcp_cd" class="frm_input" size="3"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a> <input type="text" name="cf_cert_kcp_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcp_cd']); ?>" id="cf_cert_kcp_cd" class="frm_input" size="3"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
</td> </td>
</tr> </tr>
<tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_enckey">NHN KCP 가맹점 인증키</label></th>
<td class="cf_cert_service">
<?php echo help('NHN_KCP 상점관리자 > 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키 발급 후에 인증키 정보를 입력해 주세요.<br>입력하지 않거나 잘못 입력시 휴대폰 본인확인을 취소 하셨습니다. 라고 메시지가 나오면서 창이 닫히는 오류가 발생됩니다.') ?>
<input type="text" name="cf_cert_kcp_enckey" value="<?php echo get_sanitize_input($config['cf_cert_kcp_enckey']); ?>" id="cf_cert_kcp_enckey" class="frm_input" maxlength="100" size="40"> <a href="https://partner.kcp.co.kr" target="_blank" class="btn_frmline">NHN KCP 상점관리자</a>
</td>
</tr>
<tr> <tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_limit">본인확인 이용제한</label></th> <th scope="row" class="cf_cert_service"><label for="cf_cert_limit">본인확인 이용제한</label></th>
<td class="cf_cert_service"> <td class="cf_cert_service">
+12 -10
View File
@@ -12,7 +12,6 @@ if ($is_admin != 'super') {
$cf_title = isset($_POST['cf_title']) ? strip_tags(clean_xss_attributes($_POST['cf_title'])) : ''; $cf_title = isset($_POST['cf_title']) ? strip_tags(clean_xss_attributes($_POST['cf_title'])) : '';
$cf_admin = isset($_POST['cf_admin']) ? clean_xss_tags($_POST['cf_admin'], 1, 1) : ''; $cf_admin = isset($_POST['cf_admin']) ? clean_xss_tags($_POST['cf_admin'], 1, 1) : '';
$posts = array();
$mb = get_member($cf_admin); $mb = get_member($cf_admin);
@@ -24,15 +23,15 @@ check_admin_token();
$cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',', $_POST['cf_social_servicelist']) : ''; $cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',', $_POST['cf_social_servicelist']) : '';
$check_keys = array('cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret', 'cf_cert_kg_cd', 'cf_cert_kg_mid'); $check_keys = array('cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_cert_kcp_enckey', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret', 'cf_cert_kg_cd', 'cf_cert_kg_mid');
foreach ($check_keys as $key) { foreach ($check_keys as $key) {
if (isset($_POST[$key]) && $_POST[$key]) { if (isset($_POST[$key]) && $_POST[$key]) {
$posts[$key] = $_POST[$key] = preg_replace('/[^a-z0-9_\-\.]/i', '', $_POST[$key]); $_POST[$key] = preg_replace('/[^a-z0-9_\-\.]/i', '', $_POST[$key]);
} }
} }
$posts['cf_icode_server_port'] = $_POST['cf_icode_server_port'] = isset($_POST['cf_icode_server_port']) ? preg_replace('/[^0-9]/', '', $_POST['cf_icode_server_port']) : '7295'; $_POST['cf_icode_server_port'] = isset($_POST['cf_icode_server_port']) ? preg_replace('/[^0-9]/', '', $_POST['cf_icode_server_port']) : '7295';
if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) { if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) {
$pattern = explode("\n", trim($_POST['cf_intercept_ip'])); $pattern = explode("\n", trim($_POST['cf_intercept_ip']));
@@ -105,6 +104,7 @@ $check_keys = array(
'cf_cert_ipin' => 'char', 'cf_cert_ipin' => 'char',
'cf_cert_hp' => 'char', 'cf_cert_hp' => 'char',
'cf_cert_simple' => 'char', 'cf_cert_simple' => 'char',
'cf_cert_use_seed' => 'int',
'cf_admin_email' => 'char', 'cf_admin_email' => 'char',
'cf_admin_email_name' => 'char', 'cf_admin_email_name' => 'char',
'cf_add_script' => 'text', 'cf_add_script' => 'text',
@@ -164,12 +164,12 @@ for ($i = 1; $i <= 10; $i++) {
foreach ($check_keys as $k => $v) { foreach ($check_keys as $k => $v) {
if ($v === 'int') { if ($v === 'int') {
$posts[$key] = $_POST[$k] = isset($_POST[$k]) ? (int) $_POST[$k] : 0; $_POST[$k] = isset($_POST[$k]) ? (int) $_POST[$k] : 0;
} else { } else {
if (in_array($k, array('cf_analytics', 'cf_add_meta', 'cf_add_script', 'cf_stipulation', 'cf_privacy'))) { if (in_array($k, array('cf_analytics', 'cf_add_meta', 'cf_add_script', 'cf_stipulation', 'cf_privacy'))) {
$posts[$key] = $_POST[$k] = isset($_POST[$k]) ? $_POST[$k] : ''; $_POST[$k] = isset($_POST[$k]) ? $_POST[$k] : '';
} else { } else {
$posts[$key] = $_POST[$k] = isset($_POST[$k]) ? strip_tags(clean_xss_attributes($_POST[$k])) : ''; $_POST[$k] = isset($_POST[$k]) ? strip_tags(clean_xss_attributes($_POST[$k])) : '';
} }
} }
} }
@@ -180,9 +180,9 @@ if ($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] &&
} }
if (!$_POST['cf_cert_use']) { if (!$_POST['cf_cert_use']) {
$posts[$key] = $_POST['cf_cert_ipin'] = ''; $_POST['cf_cert_ipin'] = '';
$posts[$key] = $_POST['cf_cert_hp'] = ''; $_POST['cf_cert_hp'] = '';
$posts[$key] = $_POST['cf_cert_simple'] = ''; $_POST['cf_cert_simple'] = '';
} }
$sql = " update {$g5['config_table']} $sql = " update {$g5['config_table']}
@@ -284,10 +284,12 @@ $sql = " update {$g5['config_table']}
cf_cert_ipin = '{$_POST['cf_cert_ipin']}', cf_cert_ipin = '{$_POST['cf_cert_ipin']}',
cf_cert_hp = '{$_POST['cf_cert_hp']}', cf_cert_hp = '{$_POST['cf_cert_hp']}',
cf_cert_simple = '{$_POST['cf_cert_simple']}', cf_cert_simple = '{$_POST['cf_cert_simple']}',
cf_cert_use_seed = '".(int)$_POST['cf_cert_use_seed']."',
cf_cert_kg_cd = '{$_POST['cf_cert_kg_cd']}', cf_cert_kg_cd = '{$_POST['cf_cert_kg_cd']}',
cf_cert_kg_mid = '" . trim($_POST['cf_cert_kg_mid']) . "', cf_cert_kg_mid = '" . trim($_POST['cf_cert_kg_mid']) . "',
cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_cd']}', cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_cd']}',
cf_cert_kcp_cd = '{$_POST['cf_cert_kcp_cd']}', cf_cert_kcp_cd = '{$_POST['cf_cert_kcp_cd']}',
cf_cert_kcp_enckey = '{$_POST['cf_cert_kcp_enckey']}',
cf_cert_limit = '{$_POST['cf_cert_limit']}', cf_cert_limit = '{$_POST['cf_cert_limit']}',
cf_cert_req = '{$_POST['cf_cert_req']}', cf_cert_req = '{$_POST['cf_cert_req']}',
cf_sms_use = '{$_POST['cf_sms_use']}', cf_sms_use = '{$_POST['cf_sms_use']}',
+1 -1
View File
@@ -205,7 +205,7 @@ if (isset($mb_id) && $mb_id) {
if ($mb['mb_intercept_date']) { if ($mb['mb_intercept_date']) {
$g5['title'] = "차단된 "; $g5['title'] = "차단된 ";
} else { } else {
$g5['title'] .= ""; $g5['title'] = "";
} }
$g5['title'] .= '회원 ' . $html_title; $g5['title'] .= '회원 ' . $html_title;
require_once './admin.head.php'; require_once './admin.head.php';
+2
View File
@@ -133,6 +133,8 @@ function pg_setting_check($is_print=false){
$pg_msg = 'LG유플러스'; $pg_msg = 'LG유플러스';
} else if ( $default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] && $default['de_inicis_sign_key'] ){ } else if ( $default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] && $default['de_inicis_sign_key'] ){
$pg_msg = 'KG이니시스'; $pg_msg = 'KG이니시스';
} else if ( $default['de_pg_service'] === 'nicepay' && $default['de_nicepay_mid'] && $default['de_nicepay_key'] ){
$pg_msg = 'NICEPAY';
} }
} }
+2 -2
View File
@@ -1067,8 +1067,8 @@ if(!$default['de_kakaopay_cancelpwd']){
<a href="http://testadmin8.kcp.co.kr/" target="_blank" class="btn_frmline">테스트 관리자</a> <a href="http://testadmin8.kcp.co.kr/" target="_blank" class="btn_frmline">테스트 관리자</a>
</div> </div>
<div class="scf_cardtest lg_cardtest"> <div class="scf_cardtest lg_cardtest">
<a href="https://pgweb.uplus.co.kr/" target="_blank" class="btn_frmline">실결제 관리자</a> <a href="https://pgweb.tosspayments.com/" target="_blank" class="btn_frmline">실결제 관리자</a>
<a href="https://pgweb.uplus.co.kr/tmert" target="_blank" class="btn_frmline">테스트 관리자</a> <a href="https://pgweb.tosspayments.com/tmert" target="_blank" class="btn_frmline">테스트 관리자</a>
</div> </div>
<div class="scf_cardtest inicis_cardtest"> <div class="scf_cardtest inicis_cardtest">
<a href="https://iniweb.inicis.com/" target="_blank" class="btn_frmline">상점 관리자</a> <a href="https://iniweb.inicis.com/" target="_blank" class="btn_frmline">상점 관리자</a>
+2 -3
View File
@@ -35,7 +35,7 @@ $sql_common .= $sql_search;
// 테이블의 전체 레코드수만 얻음 // 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common; $sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql); $row = sql_fetch($sql);
$total_count = $row['cnt']; $total_count = isset($row['cnt']) ? $row['cnt'] : 0;
$rows = $config['cf_page_rows']; $rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
@@ -159,7 +159,6 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$it_stock_qty_st = ''; // 스타일 정의 $it_stock_qty_st = ''; // 스타일 정의
if($row['it_stock_qty'] <= $row['it_noti_qty']) { if($row['it_stock_qty'] <= $row['it_noti_qty']) {
$it_stock_qty_st = ' sit_stock_qty_alert'; $it_stock_qty_st = ' sit_stock_qty_alert';
$it_stock_qty = ''.$it_stock_qty.' !<span class="sound_only"> 재고부족 </span>';
} }
$bg = 'bg'.($i%2); $bg = 'bg'.($i%2);
@@ -171,7 +170,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
<?php echo $row['it_id']; ?> <?php echo $row['it_id']; ?>
</td> </td>
<td class="td_left"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td> <td class="td_left"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
<td class="td_num<?php echo $it_stock_qty_st; ?>"><?php echo (int)$it_stock_qty; ?></td> <td class="td_num<?php echo $it_stock_qty_st; ?>"><?php echo $it_stock_qty; ?></td>
<td class="td_num"><?php echo number_format((float)$wait_qty); ?></td> <td class="td_num"><?php echo number_format((float)$wait_qty); ?></td>
<td class="td_num"><?php echo number_format((float)$temporary_qty); ?></td> <td class="td_num"><?php echo number_format((float)$temporary_qty); ?></td>
<td class="td_num"> <td class="td_num">
+2 -2
View File
@@ -510,10 +510,10 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
if ($od['od_settle_case'] != '무통장') { if ($od['od_settle_case'] != '무통장') {
switch($od['od_pg']) { switch($od['od_pg']) {
case 'lg': case 'lg':
$pg_url = 'http://pgweb.uplus.co.kr'; $pg_url = 'http://pgweb.tosspayments.com';
$pg_test = '토스페이먼츠'; $pg_test = '토스페이먼츠';
if ($default['de_card_test']) { if ($default['de_card_test']) {
$pg_url = 'http://pgweb.uplus.co.kr/tmert'; $pg_url = 'http://pgweb.tosspayments.com/tmert';
$pg_test .= ' 테스트 '; $pg_test .= ' 테스트 ';
} }
break; break;
+3 -3
View File
@@ -49,7 +49,7 @@ if ($csv == 'csv')
$to_date = date_conv($to_date); $to_date = date_conv($to_date);
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type $sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id "; where a.od_id = b.od_id ";
if ($case == 1) // 출력기간 if ($case == 1) // 출력기간
@@ -65,7 +65,7 @@ if ($csv == 'csv')
alert("출력할 내역이 없습니다."); alert("출력할 내역이 없습니다.");
//header('Content-Type: text/x-csv'); //header('Content-Type: text/x-csv');
header("Content-charset=utf-8"); header("Content-Type: text/csv; charset=utf-8");
header('Content-Type: doesn/matter'); header('Content-Type: doesn/matter');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename="orderlist-' . date("ymd", time()) . '.csv"'); header('Content-Disposition: attachment; filename="orderlist-' . date("ymd", time()) . '.csv"');
@@ -153,7 +153,7 @@ if ($csv == 'xls')
$fr_date = date_conv($fr_date); $fr_date = date_conv($fr_date);
$to_date = date_conv($to_date); $to_date = date_conv($to_date);
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type $sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id "; where a.od_id = b.od_id ";
if ($case == 1) // 출력기간 if ($case == 1) // 출력기간
+6
View File
@@ -44,6 +44,12 @@ if($popup == 'yes') { // 팝업창일 때
$pp['pp_price'] = $od['od_misu']; $pp['pp_price'] = $od['od_misu'];
$wrp_tag_st = '<div class="new_win">'.PHP_EOL.'<h1 id="new_win_title">'.$html_title.'</h1>'; $wrp_tag_st = '<div class="new_win">'.PHP_EOL.'<h1 id="new_win_title">'.$html_title.'</h1>';
$wrp_tag_end = '</div>'; $wrp_tag_end = '</div>';
echo '<script>
if (typeof g5_admin_csrf_token_key === "undefined") {
var g5_admin_csrf_token_key = "' . (function_exists('admin_csrf_token_key') ? admin_csrf_token_key() : '') . '";
}
</script>';
} }
else { // 현재페이지일 때 else { // 현재페이지일 때
include_once (G5_ADMIN_PATH.'/admin.head.php'); include_once (G5_ADMIN_PATH.'/admin.head.php');
+2 -2
View File
@@ -4,8 +4,8 @@ include_once('./_common.php');
if (!$is_member) die('0'); if (!$is_member) die('0');
$uid = isset($_REQUEST['uid']) ? preg_replace('/[^0-9]/', '', $_REQUEST['uid']) : 0; $uid = isset($_REQUEST['uid']) ? preg_replace('/[^0-9]/', '', $_REQUEST['uid']) : 0;
$subject = isset($_REQUEST['subject']) ? trim($_REQUEST['subject']) : ''; $subject = isset($_REQUEST['subject']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['subject']),0,255)) : '';
$content = isset($_REQUEST['content']) ? trim($_REQUEST['content']) : ''; $content = isset($_REQUEST['content']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['content']),0,65536)) : '';
if ($subject && $content) { if ($subject && $content) {
$sql = " select count(*) as cnt from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' "; $sql = " select count(*) as cnt from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' ";
-1
View File
@@ -8,7 +8,6 @@ if( function_exists('social_check_login_before') ){
$g5['title'] = '로그인'; $g5['title'] = '로그인';
include_once('./_head.sub.php'); include_once('./_head.sub.php');
$url = isset($_GET['url']) ? strip_tags($_GET['url']) : '';
$od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : ''; $od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : '';
// url 체크 // url 체크
+9 -1
View File
@@ -147,8 +147,16 @@ if(function_exists('set_cart_id')){
cart_item_clean(); cart_item_clean();
set_cart_id(''); set_cart_id('');
$s_cart_id = get_session('ss_cart_id'); $s_cart_id = get_session('ss_cart_id');
$add_cart_where = '';
// 장바구니에서 주문하기를 하는 경우
if (strpos($link, 'orderform.php') !== false) {
$add_cart_where = " and ct_select_time < '".date('Y-m-d H:i:s', strtotime('-1 hour', G5_SERVER_TIME))."' ";
}
// 선택필드 초기화 // 선택필드 초기화
$sql = " update {$g5['g5_shop_cart_table']} set ct_select = '0' where od_id = '$s_cart_id' "; $sql = " update {$g5['g5_shop_cart_table']} set ct_select = '0' where od_id = '$s_cart_id' $add_cart_where ";
sql_query($sql); sql_query($sql);
} }
+4 -2
View File
@@ -4,8 +4,6 @@ include_once('./_common.php');
if ($is_guest) if ($is_guest)
alert('로그인 한 회원만 접근하실 수 있습니다.', G5_BBS_URL.'/login.php'); alert('로그인 한 회원만 접근하실 수 있습니다.', G5_BBS_URL.'/login.php');
$url = isset($_GET['url']) ? clean_xss_tags($_GET['url']) : '';
while (1) { while (1) {
$tmp = preg_replace('/&#[^;]+;/', '', $url); $tmp = preg_replace('/&#[^;]+;/', '', $url);
if ($tmp == $url) break; if ($tmp == $url) break;
@@ -31,6 +29,10 @@ if($url){
if( preg_match('#^/{3,}#', $url) ){ if( preg_match('#^/{3,}#', $url) ){
$url = preg_replace('#^/{3,}#', '/', $url); $url = preg_replace('#^/{3,}#', '/', $url);
} }
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
} }
$url = get_text($url); $url = get_text($url);
+9 -5
View File
@@ -14,24 +14,28 @@ $str_nick_list = '';
$msg = ''; $msg = '';
$error_list = array(); $error_list = array();
$member_list = array('id'=>array(), 'nick'=>array()); $member_list = array('id'=>array(), 'nick'=>array());
$me_memo = isset($_POST['me_memo']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['me_memo']),0,65536)) : '';
run_event('memo_form_update_before', $recv_list); run_event('memo_form_update_before', $recv_list);
for ($i=0; $i<count($recv_list); $i++) { for ($i=0; $i<count($recv_list); $i++) {
$row = sql_fetch(" select mb_id, mb_nick, mb_open, mb_leave_date, mb_intercept_date from {$g5['member_table']} where mb_id = '{$recv_list[$i]}' ");
$recv_list_id = substr(preg_replace("/[^a-zA-Z0-9_]*/", "", $recv_list[$i]), 0, 20);
$row = sql_fetch(" select mb_id, mb_nick, mb_open, mb_leave_date, mb_intercept_date from {$g5['member_table']} where mb_id = '{$recv_list_id}' ");
if ($row) { if ($row) {
if ($is_admin || ($row['mb_open'] && (!$row['mb_leave_date'] && !$row['mb_intercept_date']))) { if ($is_admin || ($row['mb_open'] && (!$row['mb_leave_date'] && !$row['mb_intercept_date']))) {
$member_list['id'][] = $row['mb_id']; $member_list['id'][] = $row['mb_id'];
$member_list['nick'][] = $row['mb_nick']; $member_list['nick'][] = $row['mb_nick'];
} else { } else {
$error_list[] = $recv_list[$i]; $error_list[] = $recv_list_id;
} }
} }
/* /*
// 관리자가 아니면서 // 관리자가 아니면서
// 가입된 회원이 아니거나 정보공개를 하지 않았거나 탈퇴한 회원이거나 차단된 회원에게 쪽지를 보내는것은 에러 // 가입된 회원이 아니거나 정보공개를 하지 않았거나 탈퇴한 회원이거나 차단된 회원에게 쪽지를 보내는것은 에러
if ((!$row['mb_id'] || !$row['mb_open'] || $row['mb_leave_date'] || $row['mb_intercept_date']) && !$is_admin) { if ((!$row['mb_id'] || !$row['mb_open'] || $row['mb_leave_date'] || $row['mb_intercept_date']) && !$is_admin) {
$error_list[] = $recv_list[$i]; $error_list[] = $recv_list_id;
} else { } else {
$member_list['id'][] = $row['mb_id']; $member_list['id'][] = $row['mb_id'];
$member_list['nick'][] = $row['mb_nick']; $member_list['nick'][] = $row['mb_nick'];
@@ -67,14 +71,14 @@ for ($i=0; $i<count($member_list['id']); $i++) {
$recv_mb_nick = get_text($member_list['nick'][$i]); $recv_mb_nick = get_text($member_list['nick'][$i]);
// 받는 회원 쪽지 INSERT // 받는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '0000-00-00 00:00:00' , 'recv', '{$_SERVER['REMOTE_ADDR']}' ) "; $sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$me_memo}', '0000-00-00 00:00:00' , 'recv', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql); sql_query($sql);
if( $me_id = sql_insert_id() ){ if( $me_id = sql_insert_id() ){
// 보내는 회원 쪽지 INSERT // 보내는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '0000-00-00 00:00:00', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) "; $sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$me_memo}', '0000-00-00 00:00:00', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql); sql_query($sql);
$member_list['me_id'][$i] = $me_id; $member_list['me_id'][$i] = $me_id;
+1 -1
View File
@@ -80,7 +80,7 @@ while ($row = sql_fetch_array($result))
} }
$sql = " insert into $move_write_table $sql = " insert into $move_write_table
set wr_num = " . ($next_wr_num ? "'$next_wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $move_write_table sq) ") . ", set wr_num = " . ($next_wr_num ? "'$next_wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $move_write_table as sq) ") . ",
wr_reply = '{$row2['wr_reply']}', wr_reply = '{$row2['wr_reply']}',
wr_is_comment = '{$row2['wr_is_comment']}', wr_is_comment = '{$row2['wr_is_comment']}',
wr_comment = '{$row2['wr_comment']}', wr_comment = '{$row2['wr_comment']}',
+1 -1
View File
@@ -3,7 +3,7 @@ include_once('./_common.php');
$po_id = isset($_POST['po_id']) ? preg_replace('/[^0-9]/', '', $_POST['po_id']) : 0; $po_id = isset($_POST['po_id']) ? preg_replace('/[^0-9]/', '', $_POST['po_id']) : 0;
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '{$_POST['po_id']}' "); $po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '$po_id' ");
if (! (isset($po['po_id']) && $po['po_id'])) if (! (isset($po['po_id']) && $po['po_id']))
alert('po_id 값이 제대로 넘어오지 않았습니다.'); alert('po_id 값이 제대로 넘어오지 않았습니다.');
+2 -7
View File
@@ -58,15 +58,10 @@ include_once($g5_path['path'].'/config.php'); // 설정 파일
unset($g5_path); unset($g5_path);
// IIS 에서 SERVER_ADDR 서버변수가 없다면 // IIS 에서 SERVER_ADDR 서버변수가 없다면
if(! isset($_SERVER['SERVER_ADDR'])) { if (!isset($_SERVER['SERVER_ADDR'])) {
$_SERVER['SERVER_ADDR'] = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : ''; $_SERVER['SERVER_ADDR'] = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : '';
} }
// Cloudflare 환경을 고려한 https 사용여부
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === "https") {
$_SERVER['HTTPS'] = 'on';
}
// multi-dimensional array에 사용자지정 함수적용 // multi-dimensional array에 사용자지정 함수적용
function array_map_deep($fn, $array) function array_map_deep($fn, $array)
{ {
@@ -505,7 +500,7 @@ if (isset($_REQUEST['bo_table']) && ! is_array($_REQUEST['bo_table'])) {
// URL ENCODING // URL ENCODING
if (isset($_REQUEST['url'])) { if (isset($_REQUEST['url'])) {
$url = strip_tags(trim($_REQUEST['url'])); $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', trim($_REQUEST['url']));
$urlencode = urlencode($url); $urlencode = urlencode($url);
} else { } else {
$url = ''; $url = '';
+5
View File
@@ -234,5 +234,10 @@ define('G5_VISIT_BROWSCAP_USE', false);
*/ */
define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4'); define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4');
// Cloudflare 사용시 REMOTE_ADDR 에 사용자 IP 적용과 https 사용 여부
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
include_once(G5_LIB_PATH.'/cloudflare.lib.php'); // cloudflare 의 ip 대역인지 체크
}
// KAKAO 우편번호 서비스 CDN // KAKAO 우편번호 서비스 CDN
define('G5_POSTCODE_JS', '<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js" async></script>'); define('G5_POSTCODE_JS', '<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js" async></script>');
+2
View File
@@ -1,6 +1,8 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
define('KGINICIS_USE_CERT_SEED', isset($config['cf_cert_use_seed']) ? (int) $config['cf_cert_use_seed'] : 1);
// 유저 사이드뷰에서 아이콘 지정 안했을시 기본 no 프로필 이미지 // 유저 사이드뷰에서 아이콘 지정 안했을시 기본 no 프로필 이미지
define('G5_NO_PROFILE_IMG', '<span class="profile_img"><img src="'.G5_IMG_URL.'/no_profile.gif" alt="no_profile" width="'.$config['cf_member_icon_width'].'" height="'.$config['cf_member_icon_height'].'"></span>'); define('G5_NO_PROFILE_IMG', '<span class="profile_img"><img src="'.G5_IMG_URL.'/no_profile.gif" alt="no_profile" width="'.$config['cf_member_icon_width'].'" height="'.$config['cf_member_icon_height'].'"></span>');
+3 -1
View File
@@ -292,8 +292,10 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_cert_simple` varchar(255) NOT NULL DEFAULT '', `cf_cert_simple` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kg_cd` varchar(255) NOT NULL DEFAULT '', `cf_cert_kg_cd` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kg_mid` varchar(255) NOT NULL DEFAULT '', `cf_cert_kg_mid` varchar(255) NOT NULL DEFAULT '',
`cf_cert_use_seed` tinyint(4) NOT NULL DEFAULT '1',
`cf_cert_kcb_cd` varchar(255) NOT NULL DEFAULT '', `cf_cert_kcb_cd` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kcp_cd` varchar(255) NOT NULL DEFAULT '', `cf_cert_kcp_cd` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kcp_enckey` varchar(100) NOT NULL DEFAULT '',
`cf_lg_mid` varchar(100) NOT NULL DEFAULT '', `cf_lg_mid` varchar(100) NOT NULL DEFAULT '',
`cf_lg_mert_key` varchar(100) NOT NULL DEFAULT '', `cf_lg_mert_key` varchar(100) NOT NULL DEFAULT '',
`cf_cert_limit` int(11) NOT NULL DEFAULT '0', `cf_cert_limit` int(11) NOT NULL DEFAULT '0',
@@ -908,7 +910,7 @@ CREATE TABLE IF NOT EXISTS `g5_member_social_profiles` (
`description` varchar(255) NOT NULL DEFAULT '', `description` varchar(255) NOT NULL DEFAULT '',
`mp_register_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `mp_register_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`mp_latest_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `mp_latest_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
UNIQUE KEY `mp_no` (`mp_no`), PRIMARY KEY (`mp_no`),
KEY `mb_id` (`mb_id`), KEY `mb_id` (`mb_id`),
KEY `provider` (`provider`) KEY `provider` (`provider`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+1 -1
View File
@@ -134,7 +134,7 @@ function no_comma(data)
function del(href) function del(href)
{ {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) { if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
document.location.href = href; window.location.href = href;
} }
} }
+112
View File
@@ -0,0 +1,112 @@
<?php
if (!defined('_GNUBOARD_')) exit;
// CloudFlare를 사용시, 사용자 환경에 맞는 $_SERVER['REMOTE_ADDR']과 $_SERVER['HTTPS'] 사용 여부를 수정합니다.
class G5CheckCloudFlare {
public static function check_cloudflare_ips($user_ip){
// 클라우드플레어 IP, https://www.cloudflare.com/ips
$cloudflare_ips = array(
// IPv4
'173.245.48.0/20',
'103.21.244.0/22',
'103.22.200.0/22',
'103.31.4.0/22',
'141.101.64.0/18',
'108.162.192.0/18',
'190.93.240.0/20',
'188.114.96.0/20',
'197.234.240.0/22',
'198.41.128.0/17',
'162.158.0.0/15',
'104.16.0.0/12',
'104.24.0.0/14',
'172.64.0.0/13',
'131.0.72.0/22',
// IPv6
'2400:cb00::/32',
'2606:4700::/32',
'2803:f800::/32',
'2405:b500::/32',
'2405:8100::/32',
'2a06:98c0::/29',
'2c0f:f248::/32',
);
// 사용자 IP가 Cloudflare IP 대역 범위에 있는지 확인
$is_cloudflare_ip = false;
foreach ($cloudflare_ips as $cidr) {
if (self::ip_in_range($user_ip, $cidr)) {
$is_cloudflare_ip = true;
break;
}
}
return $is_cloudflare_ip;
}
// IP 주소가 CIDR 범위 내에 있는지 확인하는 함수 (IPv4, IPv6 모두 가능)
public static function ip_in_range($ip, $range) {
// IPv4와 IPv6를 구분
if (strpos($range, ':') === false && preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/', $ip)) {
// IPv4 처리
return self::ipv4_in_range($ip, $range);
} elseif (strpos($range, ':') !== false && strpos($ip, ':') !== false) {
// IPv6 처리
return self::ipv6_in_range($ip, $range);
}
return false;
}
// IPv4 CIDR 범위 검사
public static function ipv4_in_range($ip, $range) {
list($range, $netmask) = explode('/', $range, 2);
$range_decimal = ip2long($range);
$ip_decimal = ip2long($ip);
$wildcard_decimal = pow(2, (32 - $netmask)) - 1;
$netmask_decimal = ~$wildcard_decimal;
return (($ip_decimal & $netmask_decimal) == ($range_decimal & $netmask_decimal));
}
// IPv6 CIDR 범위 검사
public static function ipv6_in_range($ip, $range) {
list($range_ip, $netmask) = explode('/', $range, 2);
$netmask = (int) $netmask;
$ip_bin = @inet_pton($ip);
$range_bin = @inet_pton($range_ip);
// IPv6 주소는 128비트이므로, 비트마스크를 적용
$unpacked = unpack('A16', $ip_bin);
$ip_bits = $unpacked[1];
$unpacked2 = unpack('A16', $range_bin);
$range_bits = $unpacked2[1];
for ($i = 0; $i < (int)($netmask / 8); $i++) {
if ($ip_bits[$i] !== $range_bits[$i]) {
return false;
}
}
$remainder = $netmask % 8;
if ($remainder) {
$mask = 0xFF << (8 - $remainder);
return (ord($ip_bits[$i]) & $mask) === (ord($range_bits[$i]) & $mask);
}
return true;
}
}
if ($_SERVER['HTTP_CF_CONNECTING_IP'] && G5CheckCloudFlare::check_cloudflare_ips($_SERVER['REMOTE_ADDR'])) {
$_SERVER['REMOTE_ADDR'] = preg_replace('/[^0-9a-fA-F:.]/', '', $_SERVER['HTTP_CF_CONNECTING_IP']);
// Cloudflare 환경을 고려한 https 사용여부
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === "https") {
$_SERVER['HTTPS'] = 'on';
} elseif (isset($_SERVER['HTTP_CF_VISITOR']) && stripos($_SERVER['HTTP_CF_VISITOR'], 'https') !== false) {
$_SERVER['HTTPS'] = 'on';
}
}
+51 -10
View File
@@ -102,6 +102,10 @@ function goto_url($url)
{ {
run_event('goto_url', $url); run_event('goto_url', $url);
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
$url = str_replace("&amp;", "&", $url); $url = str_replace("&amp;", "&", $url);
//echo "<script> location.replace('$url'); </script>"; //echo "<script> location.replace('$url'); </script>";
@@ -182,6 +186,10 @@ function alert($msg='', $url='', $error=true, $post=false)
run_event('alert', $msg, $url, $error, $post); run_event('alert', $msg, $url, $error, $post);
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
$msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.'; $msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.';
$header = ''; $header = '';
@@ -220,6 +228,12 @@ function confirm($msg, $url1='', $url2='', $url3='')
alert($msg); alert($msg);
} }
if (function_exists('safe_filter_url_host')) {
$url1 = safe_filter_url_host($url1);
$url2 = safe_filter_url_host($url2);
$url3 = safe_filter_url_host($url3);
}
if(!trim($url1) || !trim($url2)) { if(!trim($url1) || !trim($url2)) {
$msg = '$url1 과 $url2 를 지정해 주세요.'; $msg = '$url1 과 $url2 를 지정해 주세요.';
alert($msg); alert($msg);
@@ -712,7 +726,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
$tmp = explode(",", trim($search_field)); $tmp = explode(",", trim($search_field));
$field = explode("||", $tmp[0]); $field = explode("||", $tmp[0]);
$not_comment = ""; $not_comment = "";
if (!empty($tmp[1])) if (isset($tmp[1]))
$not_comment = $tmp[1]; $not_comment = $tmp[1];
$str .= "("; $str .= "(";
@@ -768,8 +782,11 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
$op1 = " $search_operator "; $op1 = " $search_operator ";
} }
$str .= " ) "; $str .= " ) ";
if ($not_comment) if ($not_comment === '1') {
$str .= " and wr_is_comment = '0' "; $str .= " and wr_is_comment = '0' ";
} else if ($not_comment === '0') {
$str .= " and wr_is_comment = '1' ";
}
return $str; return $str;
} }
@@ -832,23 +849,33 @@ function get_group($gr_id, $is_cache=false)
} }
// 회원 정보를 얻는다. /**
function get_member($mb_id, $fields='*', $is_cache=false) * 회원 정보를 얻는다
*
* @param string $mb_id
* @param string $fields
* @param bool $is_cache
*
* @return array
*/
function get_member($mb_id, $fields = '*', $is_cache = false)
{ {
global $g5; global $g5;
if (preg_match("/[^0-9a-z_]+/i", $mb_id)) $mb_id = trim($mb_id);
if (preg_match("/[^0-9a-z_]+/i", $mb_id)) {
return array(); return array();
}
static $cache = array(); static $cache = array();
$key = md5($fields); $key = md5($fields);
if( $is_cache && isset($cache[$mb_id]) && isset($cache[$mb_id][$key]) ){ if ($is_cache && isset($cache[$mb_id]) && isset($cache[$mb_id][$key])) {
return $cache[$mb_id][$key]; return $cache[$mb_id][$key];
} }
$sql = " select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') "; $sql = " SELECT {$fields} from {$g5['member_table']} where mb_id = '{$mb_id}' ";
$cache[$mb_id][$key] = run_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache); $cache[$mb_id][$key] = run_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache);
@@ -1320,6 +1347,10 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
and po_rel_action = '$rel_action' "; and po_rel_action = '$rel_action' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (! (isset($row['po_id']) && $row['po_id'])) {
return true;
}
if(isset($row['po_point']) && $row['po_point'] < 0) { if(isset($row['po_point']) && $row['po_point'] < 0) {
$mb_id = $row['mb_id']; $mb_id = $row['mb_id'];
$po_point = abs($row['po_point']); $po_point = abs($row['po_point']);
@@ -1652,7 +1683,10 @@ function sql_connect($host, $user, $pass, $db=G5_MYSQL_DB)
die('Connect Error: '.mysqli_connect_error()); die('Connect Error: '.mysqli_connect_error());
} }
} else { } else {
$link = mysql_connect($host, $user, $pass); if (!function_exists('mysql_connect')) {
die('MySQL이 설치되지 않아 mysql_connect 함수를 사용할 수 없습니다.');
}
$link = mysql_connect($host, $user, $pass) or die('MySQL Host, User, Password 정보에 오류가 있습니다.');
} }
return $link; return $link;
@@ -2098,7 +2132,7 @@ function time_select($time, $name="")
preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2})/", $time, $m); preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2})/", $time, $m);
// 시 // 시
$s .= "<select name='{$name}_h'>"; $s = "<select name='{$name}_h'>";
for ($i=0; $i<=23; $i++) { for ($i=0; $i<=23; $i++) {
$s .= "<option value='$i'"; $s .= "<option value='$i'";
if ($i == $m['0']) { if ($i == $m['0']) {
@@ -3594,6 +3628,13 @@ function login_password_check($mb, $pass, $hash)
return check_password($pass, $hash); return check_password($pass, $hash);
} }
function safe_filter_url_host($url) {
$regex = run_replace('safe_filter_url_regex', '\\', $url);
return $regex ? preg_replace('#'. preg_quote($regex, '#') .'#iu', '', $url) : '';
}
// 동일한 host url 인지 // 동일한 host url 인지
function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false) function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
{ {
+2
View File
@@ -145,6 +145,8 @@ function get_content_by_field($write_table, $type='bbs', $where_field='', $where
{ {
global $g5, $g5_object; global $g5, $g5_object;
static $cache = array();
$order_key = 'wr_id'; $order_key = 'wr_id';
if( $type === 'content' ){ if( $type === 'content' ){
+1 -1
View File
@@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
// 최신글 추출 // 최신글 추출
// $cache_time 캐시 갱신시간 // $cache_time 캐시 갱신시간
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=1, $options='') function latest($skin_dir='', $bo_table='', $rows=10, $subject_len=40, $cache_time=1, $options='')
{ {
global $g5; global $g5;
+1 -1
View File
@@ -2747,7 +2747,7 @@ function is_inicis_order_pay($type){
return false; return false;
} }
function get_item_images_info($it, $size=array(), $image_width, $image_height){ function get_item_images_info($it, $size=array(), $image_width=0, $image_height=0){
if( !(is_array($it) && $it) ) return array(); if( !(is_array($it) && $it) ) return array();
$images = array(); $images = array();
+18 -1
View File
@@ -9,7 +9,6 @@
/* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */ /* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */
/* ============================================================================== */ /* ============================================================================== */
/* ============================================================================== */ /* ============================================================================== */
/* = 환경 설정 파일 Include = */ /* = 환경 설정 파일 Include = */
/* = -------------------------------------------------------------------------- = */ /* = -------------------------------------------------------------------------- = */
@@ -110,6 +109,24 @@
/* = -------------------------------------------------------------------------- = */ /* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" ) if ( $req_tx == "pay" )
{ {
/* 1004원은 실제로 업체에서 결제하셔야 될 원 금액을 넣어주셔야 합니다. 결제금액 유효성 검증 */
$c_PayPlus->mf_set_ordr_data( "ordr_mony", $good_mny );
$kcp_pay_type = ''; // 결제수단 검증 파라미터 pay_type (신용카드 : PACA, 계좌이체 : PABK, 가상계좌 : PAVC, 휴대폰 : PAMC)
if ($use_pay_method == "100000000000" && (in_array($od_settle_case, array('신용카드', '간편결제')))) { // 신용카드
$kcp_pay_type = 'PACA';
} else if ($use_pay_method == "010000000000" && $od_settle_case === '계좌이체') { // 계좌이체
$kcp_pay_type = 'PABK';
} else if ($use_pay_method == "001000000000" && $od_settle_case === '가상계좌') { // 가상계좌
$kcp_pay_type = 'PAVC';
} else if ($use_pay_method == "000010000000" && $od_settle_case === '휴대폰') { // 휴대폰
$kcp_pay_type = 'PAMC';
}
$c_PayPlus->mf_set_ordr_data( "pay_type", $kcp_pay_type );
$c_PayPlus->mf_set_ordr_data( "ordr_no", $ordr_idxx );
$post_enc_data = isset($_POST["enc_data"]) ? $_POST["enc_data"] : ''; $post_enc_data = isset($_POST["enc_data"]) ? $_POST["enc_data"] : '';
$post_enc_info = isset($_POST["enc_info"]) ? $_POST["enc_info"] : ''; $post_enc_info = isset($_POST["enc_info"]) ? $_POST["enc_info"] : '';
+4 -2
View File
@@ -80,6 +80,8 @@ $payReqMap['LGD_HASHDATA'] = $LGD_HASHDATA; // MD5 해쉬
$payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지 $payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지
$payReqMap['LGD_VERSION'] = "PHP_SmartXPay_1.0"; // 버전정보 (삭제하지 마세요) $payReqMap['LGD_VERSION'] = "PHP_SmartXPay_1.0"; // 버전정보 (삭제하지 마세요)
$payReqMap['LGD_CUSTOM_FIRSTPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단 $payReqMap['LGD_CUSTOM_FIRSTPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단
// 2024년 7월에 모바일 결제수단 키가 LGD_CUSTOM_USABLEPAY 키로 쓰이는 것을 확인함
$payReqMap['LGD_CUSTOM_USABLEPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단
$payReqMap['LGD_CUSTOM_SWITCHINGTYPE'] = "SUBMIT"; // 신용카드 카드사 인증 페이지 연동 방식 $payReqMap['LGD_CUSTOM_SWITCHINGTYPE'] = "SUBMIT"; // 신용카드 카드사 인증 페이지 연동 방식
$payReqMap['LGD_ENCODING'] = "UTF-8"; $payReqMap['LGD_ENCODING'] = "UTF-8";
$payReqMap['LGD_ENCODING_NOTEURL'] = "UTF-8"; $payReqMap['LGD_ENCODING_NOTEURL'] = "UTF-8";
@@ -137,9 +139,9 @@ include_once(G5_PATH.'/head.sub.php');
?> ?>
<?php if ($default['de_card_test']) { // 테스트 결제시 ?> <?php if ($default['de_card_test']) { // 테스트 결제시 ?>
<script language="javascript" src="https://pretest.uplus.co.kr:9443/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://js.tosspayments.com/xpay_crossplatform/sandbox/v1" type="text/javascript"></script>
<?php } else { //실 결제시 ?> <?php } else { //실 결제시 ?>
<script language="javascript" src="//xpay.uplus.co.kr/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://xpay.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
<?php } ?> <?php } ?>
<script type="text/javascript"> <script type="text/javascript">
-2
View File
@@ -4,8 +4,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 나이스페이 공통 설정 // 나이스페이 공통 설정
require_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php'); require_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
if (function_exists('add_log')) add_log($_POST);
/* /*
**************************************************************************************** ****************************************************************************************
* <Authentication Result Parameter> * <Authentication Result Parameter>
@@ -2,8 +2,6 @@
include_once('./_common.php'); include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php'); include_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
if (function_exists('add_log')) add_log($_POST);
$authResultCode = isset($_POST['AuthResultCode']) ? clean_xss_tags($_POST['AuthResultCode']) : ''; // authentication result code 0000:success $authResultCode = isset($_POST['AuthResultCode']) ? clean_xss_tags($_POST['AuthResultCode']) : ''; // authentication result code 0000:success
$authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message $authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message
$mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id $mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id
+5
View File
@@ -1548,7 +1548,12 @@ function pay_approval()
return false; return false;
} }
<?php if ($default['de_pg_service'] == 'nicepay') { ?>
nicepayStart(f); nicepayStart(f);
return false;
<?php } ?>
f.submit();
} }
return false; return false;
+9 -1
View File
@@ -698,6 +698,10 @@ if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY': case 'KAKAOPAY':
$_REQUEST['TID'] = $tno; $_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount; $_REQUEST['Amt'] = $amount;
@@ -756,6 +760,10 @@ if(!$result) {
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY': case 'KAKAOPAY':
$_REQUEST['TID'] = $tno; $_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount; $_REQUEST['Amt'] = $amount;
@@ -862,7 +870,7 @@ if($config['cf_sms_use'] && ($default['de_sms_use2'] || $default['de_sms_use3'])
$sms_content = str_replace("{보낸분}", $od_name, $sms_content); $sms_content = str_replace("{보낸분}", $od_name, $sms_content);
$sms_content = str_replace("{받는분}", $od_b_name, $sms_content); $sms_content = str_replace("{받는분}", $od_b_name, $sms_content);
$sms_content = str_replace("{주문번호}", $od_id, $sms_content); $sms_content = str_replace("{주문번호}", $od_id, $sms_content);
$sms_content = str_replace("{주문금액}", number_format($tot_ct_price + $od_send_cost + $od_send_cost2), $sms_content); $sms_content = str_replace("{주문금액}", number_format($tot_ct_price + $od_send_cost + (int) $od_send_cost2), $sms_content);
$sms_content = str_replace("{회원아이디}", $member['mb_id'], $sms_content); $sms_content = str_replace("{회원아이디}", $member['mb_id'], $sms_content);
$sms_content = str_replace("{회사명}", $default['de_admin_company_name'], $sms_content); $sms_content = str_replace("{회사명}", $default['de_admin_company_name'], $sms_content);
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -8,7 +8,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
*/ */
if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){ if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
class HTMLPurifier_Filter_iframevideo extends HTMLPurifier_Filter class HTMLPurifier_Filter_Iframevideo extends HTMLPurifier_Filter
{ {
public $name = 'Iframevideo'; public $name = 'Iframevideo';
@@ -1,15 +1,15 @@
AutoFormat.RemoveEmpty.RemoveNbsp AutoFormat.RemoveEmpty.RemoveNbsp
TYPE: bool TYPE: bool
VERSION: 4.0.0 VERSION: 4.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
When enabled, HTML Purifier will treat any elements that contain only When enabled, HTML Purifier will treat any elements that contain only
non-breaking spaces as well as regular whitespace as empty, and remove non-breaking spaces as well as regular whitespace as empty, and remove
them when %AutoFormat.RemoveEmpty is enabled. them when %AutoFormat.RemoveEmpty is enabled.
</p> </p>
<p> <p>
See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements
that don't have this behavior applied to them. that don't have this behavior applied to them.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
Core.AllowParseManyTags Core.AllowParseManyTags
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 4.10.1 VERSION: 4.10.1
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive allows parsing of many nested tags. This directive allows parsing of many nested tags.
If you set true, relaxes any hardcoded limit from the parser. If you set true, relaxes any hardcoded limit from the parser.
However, in that case it may cause a Dos attack. However, in that case it may cause a Dos attack.
Be careful when enabling it. Be careful when enabling it.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,160 +1,160 @@
Core.ColorKeywords Core.ColorKeywords
TYPE: hash TYPE: hash
VERSION: 2.0.0 VERSION: 2.0.0
--DEFAULT-- --DEFAULT--
array ( array (
'aliceblue' => '#F0F8FF', 'aliceblue' => '#F0F8FF',
'antiquewhite' => '#FAEBD7', 'antiquewhite' => '#FAEBD7',
'aqua' => '#00FFFF', 'aqua' => '#00FFFF',
'aquamarine' => '#7FFFD4', 'aquamarine' => '#7FFFD4',
'azure' => '#F0FFFF', 'azure' => '#F0FFFF',
'beige' => '#F5F5DC', 'beige' => '#F5F5DC',
'bisque' => '#FFE4C4', 'bisque' => '#FFE4C4',
'black' => '#000000', 'black' => '#000000',
'blanchedalmond' => '#FFEBCD', 'blanchedalmond' => '#FFEBCD',
'blue' => '#0000FF', 'blue' => '#0000FF',
'blueviolet' => '#8A2BE2', 'blueviolet' => '#8A2BE2',
'brown' => '#A52A2A', 'brown' => '#A52A2A',
'burlywood' => '#DEB887', 'burlywood' => '#DEB887',
'cadetblue' => '#5F9EA0', 'cadetblue' => '#5F9EA0',
'chartreuse' => '#7FFF00', 'chartreuse' => '#7FFF00',
'chocolate' => '#D2691E', 'chocolate' => '#D2691E',
'coral' => '#FF7F50', 'coral' => '#FF7F50',
'cornflowerblue' => '#6495ED', 'cornflowerblue' => '#6495ED',
'cornsilk' => '#FFF8DC', 'cornsilk' => '#FFF8DC',
'crimson' => '#DC143C', 'crimson' => '#DC143C',
'cyan' => '#00FFFF', 'cyan' => '#00FFFF',
'darkblue' => '#00008B', 'darkblue' => '#00008B',
'darkcyan' => '#008B8B', 'darkcyan' => '#008B8B',
'darkgoldenrod' => '#B8860B', 'darkgoldenrod' => '#B8860B',
'darkgray' => '#A9A9A9', 'darkgray' => '#A9A9A9',
'darkgrey' => '#A9A9A9', 'darkgrey' => '#A9A9A9',
'darkgreen' => '#006400', 'darkgreen' => '#006400',
'darkkhaki' => '#BDB76B', 'darkkhaki' => '#BDB76B',
'darkmagenta' => '#8B008B', 'darkmagenta' => '#8B008B',
'darkolivegreen' => '#556B2F', 'darkolivegreen' => '#556B2F',
'darkorange' => '#FF8C00', 'darkorange' => '#FF8C00',
'darkorchid' => '#9932CC', 'darkorchid' => '#9932CC',
'darkred' => '#8B0000', 'darkred' => '#8B0000',
'darksalmon' => '#E9967A', 'darksalmon' => '#E9967A',
'darkseagreen' => '#8FBC8F', 'darkseagreen' => '#8FBC8F',
'darkslateblue' => '#483D8B', 'darkslateblue' => '#483D8B',
'darkslategray' => '#2F4F4F', 'darkslategray' => '#2F4F4F',
'darkslategrey' => '#2F4F4F', 'darkslategrey' => '#2F4F4F',
'darkturquoise' => '#00CED1', 'darkturquoise' => '#00CED1',
'darkviolet' => '#9400D3', 'darkviolet' => '#9400D3',
'deeppink' => '#FF1493', 'deeppink' => '#FF1493',
'deepskyblue' => '#00BFFF', 'deepskyblue' => '#00BFFF',
'dimgray' => '#696969', 'dimgray' => '#696969',
'dimgrey' => '#696969', 'dimgrey' => '#696969',
'dodgerblue' => '#1E90FF', 'dodgerblue' => '#1E90FF',
'firebrick' => '#B22222', 'firebrick' => '#B22222',
'floralwhite' => '#FFFAF0', 'floralwhite' => '#FFFAF0',
'forestgreen' => '#228B22', 'forestgreen' => '#228B22',
'fuchsia' => '#FF00FF', 'fuchsia' => '#FF00FF',
'gainsboro' => '#DCDCDC', 'gainsboro' => '#DCDCDC',
'ghostwhite' => '#F8F8FF', 'ghostwhite' => '#F8F8FF',
'gold' => '#FFD700', 'gold' => '#FFD700',
'goldenrod' => '#DAA520', 'goldenrod' => '#DAA520',
'gray' => '#808080', 'gray' => '#808080',
'grey' => '#808080', 'grey' => '#808080',
'green' => '#008000', 'green' => '#008000',
'greenyellow' => '#ADFF2F', 'greenyellow' => '#ADFF2F',
'honeydew' => '#F0FFF0', 'honeydew' => '#F0FFF0',
'hotpink' => '#FF69B4', 'hotpink' => '#FF69B4',
'indianred' => '#CD5C5C', 'indianred' => '#CD5C5C',
'indigo' => '#4B0082', 'indigo' => '#4B0082',
'ivory' => '#FFFFF0', 'ivory' => '#FFFFF0',
'khaki' => '#F0E68C', 'khaki' => '#F0E68C',
'lavender' => '#E6E6FA', 'lavender' => '#E6E6FA',
'lavenderblush' => '#FFF0F5', 'lavenderblush' => '#FFF0F5',
'lawngreen' => '#7CFC00', 'lawngreen' => '#7CFC00',
'lemonchiffon' => '#FFFACD', 'lemonchiffon' => '#FFFACD',
'lightblue' => '#ADD8E6', 'lightblue' => '#ADD8E6',
'lightcoral' => '#F08080', 'lightcoral' => '#F08080',
'lightcyan' => '#E0FFFF', 'lightcyan' => '#E0FFFF',
'lightgoldenrodyellow' => '#FAFAD2', 'lightgoldenrodyellow' => '#FAFAD2',
'lightgray' => '#D3D3D3', 'lightgray' => '#D3D3D3',
'lightgrey' => '#D3D3D3', 'lightgrey' => '#D3D3D3',
'lightgreen' => '#90EE90', 'lightgreen' => '#90EE90',
'lightpink' => '#FFB6C1', 'lightpink' => '#FFB6C1',
'lightsalmon' => '#FFA07A', 'lightsalmon' => '#FFA07A',
'lightseagreen' => '#20B2AA', 'lightseagreen' => '#20B2AA',
'lightskyblue' => '#87CEFA', 'lightskyblue' => '#87CEFA',
'lightslategray' => '#778899', 'lightslategray' => '#778899',
'lightslategrey' => '#778899', 'lightslategrey' => '#778899',
'lightsteelblue' => '#B0C4DE', 'lightsteelblue' => '#B0C4DE',
'lightyellow' => '#FFFFE0', 'lightyellow' => '#FFFFE0',
'lime' => '#00FF00', 'lime' => '#00FF00',
'limegreen' => '#32CD32', 'limegreen' => '#32CD32',
'linen' => '#FAF0E6', 'linen' => '#FAF0E6',
'magenta' => '#FF00FF', 'magenta' => '#FF00FF',
'maroon' => '#800000', 'maroon' => '#800000',
'mediumaquamarine' => '#66CDAA', 'mediumaquamarine' => '#66CDAA',
'mediumblue' => '#0000CD', 'mediumblue' => '#0000CD',
'mediumorchid' => '#BA55D3', 'mediumorchid' => '#BA55D3',
'mediumpurple' => '#9370DB', 'mediumpurple' => '#9370DB',
'mediumseagreen' => '#3CB371', 'mediumseagreen' => '#3CB371',
'mediumslateblue' => '#7B68EE', 'mediumslateblue' => '#7B68EE',
'mediumspringgreen' => '#00FA9A', 'mediumspringgreen' => '#00FA9A',
'mediumturquoise' => '#48D1CC', 'mediumturquoise' => '#48D1CC',
'mediumvioletred' => '#C71585', 'mediumvioletred' => '#C71585',
'midnightblue' => '#191970', 'midnightblue' => '#191970',
'mintcream' => '#F5FFFA', 'mintcream' => '#F5FFFA',
'mistyrose' => '#FFE4E1', 'mistyrose' => '#FFE4E1',
'moccasin' => '#FFE4B5', 'moccasin' => '#FFE4B5',
'navajowhite' => '#FFDEAD', 'navajowhite' => '#FFDEAD',
'navy' => '#000080', 'navy' => '#000080',
'oldlace' => '#FDF5E6', 'oldlace' => '#FDF5E6',
'olive' => '#808000', 'olive' => '#808000',
'olivedrab' => '#6B8E23', 'olivedrab' => '#6B8E23',
'orange' => '#FFA500', 'orange' => '#FFA500',
'orangered' => '#FF4500', 'orangered' => '#FF4500',
'orchid' => '#DA70D6', 'orchid' => '#DA70D6',
'palegoldenrod' => '#EEE8AA', 'palegoldenrod' => '#EEE8AA',
'palegreen' => '#98FB98', 'palegreen' => '#98FB98',
'paleturquoise' => '#AFEEEE', 'paleturquoise' => '#AFEEEE',
'palevioletred' => '#DB7093', 'palevioletred' => '#DB7093',
'papayawhip' => '#FFEFD5', 'papayawhip' => '#FFEFD5',
'peachpuff' => '#FFDAB9', 'peachpuff' => '#FFDAB9',
'peru' => '#CD853F', 'peru' => '#CD853F',
'pink' => '#FFC0CB', 'pink' => '#FFC0CB',
'plum' => '#DDA0DD', 'plum' => '#DDA0DD',
'powderblue' => '#B0E0E6', 'powderblue' => '#B0E0E6',
'purple' => '#800080', 'purple' => '#800080',
'rebeccapurple' => '#663399', 'rebeccapurple' => '#663399',
'red' => '#FF0000', 'red' => '#FF0000',
'rosybrown' => '#BC8F8F', 'rosybrown' => '#BC8F8F',
'royalblue' => '#4169E1', 'royalblue' => '#4169E1',
'saddlebrown' => '#8B4513', 'saddlebrown' => '#8B4513',
'salmon' => '#FA8072', 'salmon' => '#FA8072',
'sandybrown' => '#F4A460', 'sandybrown' => '#F4A460',
'seagreen' => '#2E8B57', 'seagreen' => '#2E8B57',
'seashell' => '#FFF5EE', 'seashell' => '#FFF5EE',
'sienna' => '#A0522D', 'sienna' => '#A0522D',
'silver' => '#C0C0C0', 'silver' => '#C0C0C0',
'skyblue' => '#87CEEB', 'skyblue' => '#87CEEB',
'slateblue' => '#6A5ACD', 'slateblue' => '#6A5ACD',
'slategray' => '#708090', 'slategray' => '#708090',
'slategrey' => '#708090', 'slategrey' => '#708090',
'snow' => '#FFFAFA', 'snow' => '#FFFAFA',
'springgreen' => '#00FF7F', 'springgreen' => '#00FF7F',
'steelblue' => '#4682B4', 'steelblue' => '#4682B4',
'tan' => '#D2B48C', 'tan' => '#D2B48C',
'teal' => '#008080', 'teal' => '#008080',
'thistle' => '#D8BFD8', 'thistle' => '#D8BFD8',
'tomato' => '#FF6347', 'tomato' => '#FF6347',
'turquoise' => '#40E0D0', 'turquoise' => '#40E0D0',
'violet' => '#EE82EE', 'violet' => '#EE82EE',
'wheat' => '#F5DEB3', 'wheat' => '#F5DEB3',
'white' => '#FFFFFF', 'white' => '#FFFFFF',
'whitesmoke' => '#F5F5F5', 'whitesmoke' => '#F5F5F5',
'yellow' => '#FFFF00', 'yellow' => '#FFFF00',
'yellowgreen' => '#9ACD32' 'yellowgreen' => '#9ACD32'
) )
--DESCRIPTION-- --DESCRIPTION--
Lookup array of color names to six digit hexadecimal number corresponding Lookup array of color names to six digit hexadecimal number corresponding
to color, with preceding hash mark. Used when parsing colors. The lookup to color, with preceding hash mark. Used when parsing colors. The lookup
is done in a case-insensitive manner. is done in a case-insensitive manner.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
HTML.Forms HTML.Forms
TYPE: bool TYPE: bool
VERSION: 4.13.0 VERSION: 4.13.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Whether or not to permit form elements in the user input, regardless of Whether or not to permit form elements in the user input, regardless of
%HTML.Trusted value. Please be very careful when using this functionality, as %HTML.Trusted value. Please be very careful when using this functionality, as
enabling forms in untrusted documents may allow for phishing attacks. enabling forms in untrusted documents may allow for phishing attacks.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
File diff suppressed because it is too large Load Diff
@@ -1,451 +1,451 @@
<?php <?php
/** /**
* @todo Rewrite to use Interchange objects * @todo Rewrite to use Interchange objects
*/ */
class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
{ {
/** /**
* Printers for specific fields. * Printers for specific fields.
* @type HTMLPurifier_Printer[] * @type HTMLPurifier_Printer[]
*/ */
protected $fields = array(); protected $fields = array();
/** /**
* Documentation URL, can have fragment tagged on end. * Documentation URL, can have fragment tagged on end.
* @type string * @type string
*/ */
protected $docURL; protected $docURL;
/** /**
* Name of form element to stuff config in. * Name of form element to stuff config in.
* @type string * @type string
*/ */
protected $name; protected $name;
/** /**
* Whether or not to compress directive names, clipping them off * Whether or not to compress directive names, clipping them off
* after a certain amount of letters. False to disable or integer letters * after a certain amount of letters. False to disable or integer letters
* before clipping. * before clipping.
* @type bool * @type bool
*/ */
protected $compress = false; protected $compress = false;
/** /**
* @param string $name Form element name for directives to be stuffed into * @param string $name Form element name for directives to be stuffed into
* @param string $doc_url String documentation URL, will have fragment tagged on * @param string $doc_url String documentation URL, will have fragment tagged on
* @param bool $compress Integer max length before compressing a directive name, set to false to turn off * @param bool $compress Integer max length before compressing a directive name, set to false to turn off
*/ */
public function __construct( public function __construct(
$name, $name,
$doc_url = null, $doc_url = null,
$compress = false $compress = false
) { ) {
parent::__construct(); parent::__construct();
$this->docURL = $doc_url; $this->docURL = $doc_url;
$this->name = $name; $this->name = $name;
$this->compress = $compress; $this->compress = $compress;
// initialize sub-printers // initialize sub-printers
$this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default();
$this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); $this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool();
} }
/** /**
* Sets default column and row size for textareas in sub-printers * Sets default column and row size for textareas in sub-printers
* @param $cols Integer columns of textarea, null to use default * @param $cols Integer columns of textarea, null to use default
* @param $rows Integer rows of textarea, null to use default * @param $rows Integer rows of textarea, null to use default
*/ */
public function setTextareaDimensions($cols = null, $rows = null) public function setTextareaDimensions($cols = null, $rows = null)
{ {
if ($cols) { if ($cols) {
$this->fields['default']->cols = $cols; $this->fields['default']->cols = $cols;
} }
if ($rows) { if ($rows) {
$this->fields['default']->rows = $rows; $this->fields['default']->rows = $rows;
} }
} }
/** /**
* Retrieves styling, in case it is not accessible by webserver * Retrieves styling, in case it is not accessible by webserver
*/ */
public static function getCSS() public static function getCSS()
{ {
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css');
} }
/** /**
* Retrieves JavaScript, in case it is not accessible by webserver * Retrieves JavaScript, in case it is not accessible by webserver
*/ */
public static function getJavaScript() public static function getJavaScript()
{ {
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js');
} }
/** /**
* Returns HTML output for a configuration form * Returns HTML output for a configuration form
* @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array
* where [0] has an HTML namespace and [1] is being rendered. * where [0] has an HTML namespace and [1] is being rendered.
* @param array|bool $allowed Optional namespace(s) and directives to restrict form to. * @param array|bool $allowed Optional namespace(s) and directives to restrict form to.
* @param bool $render_controls * @param bool $render_controls
* @return string * @return string
*/ */
public function render($config, $allowed = true, $render_controls = true) public function render($config, $allowed = true, $render_controls = true)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->config = $config; $this->config = $config;
$this->genConfig = $gen_config; $this->genConfig = $gen_config;
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
$allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def);
$all = array(); $all = array();
foreach ($allowed as $key) { foreach ($allowed as $key) {
list($ns, $directive) = $key; list($ns, $directive) = $key;
$all[$ns][$directive] = $config->get($ns . '.' . $directive); $all[$ns][$directive] = $config->get($ns . '.' . $directive);
} }
$ret = ''; $ret = '';
$ret .= $this->start('table', array('class' => 'hp-config')); $ret .= $this->start('table', array('class' => 'hp-config'));
$ret .= $this->start('thead'); $ret .= $this->start('thead');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive'));
$ret .= $this->element('th', 'Value', array('class' => 'hp-value')); $ret .= $this->element('th', 'Value', array('class' => 'hp-value'));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('thead'); $ret .= $this->end('thead');
foreach ($all as $ns => $directives) { foreach ($all as $ns => $directives) {
$ret .= $this->renderNamespace($ns, $directives); $ret .= $this->renderNamespace($ns, $directives);
} }
if ($render_controls) { if ($render_controls) {
$ret .= $this->start('tbody'); $ret .= $this->start('tbody');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls'));
$ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit'));
$ret .= '[<a href="?">Reset</a>]'; $ret .= '[<a href="?">Reset</a>]';
$ret .= $this->end('td'); $ret .= $this->end('td');
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('tbody'); $ret .= $this->end('tbody');
} }
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders a single namespace * Renders a single namespace
* @param $ns String namespace name * @param $ns String namespace name
* @param array $directives array of directives to values * @param array $directives array of directives to values
* @return string * @return string
*/ */
protected function renderNamespace($ns, $directives) protected function renderNamespace($ns, $directives)
{ {
$ret = ''; $ret = '';
$ret .= $this->start('tbody', array('class' => 'namespace')); $ret .= $this->start('tbody', array('class' => 'namespace'));
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', $ns, array('colspan' => 2)); $ret .= $this->element('th', $ns, array('colspan' => 2));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('tbody'); $ret .= $this->end('tbody');
$ret .= $this->start('tbody'); $ret .= $this->start('tbody');
foreach ($directives as $directive => $value) { foreach ($directives as $directive => $value) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->start('th'); $ret .= $this->start('th');
if ($this->docURL) { if ($this->docURL) {
$url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL);
$ret .= $this->start('a', array('href' => $url)); $ret .= $this->start('a', array('href' => $url));
} }
$attr = array('for' => "{$this->name}:$ns.$directive"); $attr = array('for' => "{$this->name}:$ns.$directive");
// crop directive name if it's too long // crop directive name if it's too long
if (!$this->compress || (strlen($directive) < $this->compress)) { if (!$this->compress || (strlen($directive) < $this->compress)) {
$directive_disp = $directive; $directive_disp = $directive;
} else { } else {
$directive_disp = substr($directive, 0, $this->compress - 2) . '...'; $directive_disp = substr($directive, 0, $this->compress - 2) . '...';
$attr['title'] = $directive; $attr['title'] = $directive;
} }
$ret .= $this->element( $ret .= $this->element(
'label', 'label',
$directive_disp, $directive_disp,
// component printers must create an element with this id // component printers must create an element with this id
$attr $attr
); );
if ($this->docURL) { if ($this->docURL) {
$ret .= $this->end('a'); $ret .= $this->end('a');
} }
$ret .= $this->end('th'); $ret .= $this->end('th');
$ret .= $this->start('td'); $ret .= $this->start('td');
$def = $this->config->def->info["$ns.$directive"]; $def = $this->config->def->info["$ns.$directive"];
if (is_int($def)) { if (is_int($def)) {
$allow_null = $def < 0; $allow_null = $def < 0;
$type = abs($def); $type = abs($def);
} else { } else {
$type = $def->type; $type = $def->type;
$allow_null = isset($def->allow_null); $allow_null = isset($def->allow_null);
} }
if (!isset($this->fields[$type])) { if (!isset($this->fields[$type])) {
$type = 0; $type = 0;
} // default } // default
$type_obj = $this->fields[$type]; $type_obj = $this->fields[$type];
if ($allow_null) { if ($allow_null) {
$type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj);
} }
$ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config));
$ret .= $this->end('td'); $ret .= $this->end('td');
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
$ret .= $this->end('tbody'); $ret .= $this->end('tbody');
return $ret; return $ret;
} }
} }
/** /**
* Printer decorator for directives that accept null * Printer decorator for directives that accept null
*/ */
class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer
{ {
/** /**
* Printer being decorated * Printer being decorated
* @type HTMLPurifier_Printer * @type HTMLPurifier_Printer
*/ */
protected $obj; protected $obj;
/** /**
* @param HTMLPurifier_Printer $obj Printer to decorate * @param HTMLPurifier_Printer $obj Printer to decorate
*/ */
public function __construct($obj) public function __construct($obj)
{ {
parent::__construct(); parent::__construct();
$this->obj = $obj; $this->obj = $obj;
} }
/** /**
* @param string $ns * @param string $ns
* @param string $directive * @param string $directive
* @param string $value * @param string $value
* @param string $name * @param string $name
* @param HTMLPurifier_Config|array $config * @param HTMLPurifier_Config|array $config
* @return string * @return string
*/ */
public function render($ns, $directive, $value, $name, $config) public function render($ns, $directive, $value, $name, $config)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
$ret = ''; $ret = '';
$ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Null/Disabled'); $ret .= $this->text(' Null/Disabled');
$ret .= $this->end('label'); $ret .= $this->end('label');
$attr = array( $attr = array(
'type' => 'checkbox', 'type' => 'checkbox',
'value' => '1', 'value' => '1',
'class' => 'null-toggle', 'class' => 'null-toggle',
'name' => "$name" . "[Null_$ns.$directive]", 'name' => "$name" . "[Null_$ns.$directive]",
'id' => "$name:Null_$ns.$directive", 'id' => "$name:Null_$ns.$directive",
'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!!
); );
if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) {
// modify inline javascript slightly // modify inline javascript slightly
$attr['onclick'] = $attr['onclick'] =
"toggleWriteability('$name:Yes_$ns.$directive',checked);" . "toggleWriteability('$name:Yes_$ns.$directive',checked);" .
"toggleWriteability('$name:No_$ns.$directive',checked)"; "toggleWriteability('$name:No_$ns.$directive',checked)";
} }
if ($value === null) { if ($value === null) {
$attr['checked'] = 'checked'; $attr['checked'] = 'checked';
} }
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
$ret .= $this->text(' or '); $ret .= $this->text(' or ');
$ret .= $this->elementEmpty('br'); $ret .= $this->elementEmpty('br');
$ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config));
return $ret; return $ret;
} }
} }
/** /**
* Swiss-army knife configuration form field printer * Swiss-army knife configuration form field printer
*/ */
class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer
{ {
/** /**
* @type int * @type int
*/ */
public $cols = 18; public $cols = 18;
/** /**
* @type int * @type int
*/ */
public $rows = 5; public $rows = 5;
/** /**
* @param string $ns * @param string $ns
* @param string $directive * @param string $directive
* @param string $value * @param string $value
* @param string $name * @param string $name
* @param HTMLPurifier_Config|array $config * @param HTMLPurifier_Config|array $config
* @return string * @return string
*/ */
public function render($ns, $directive, $value, $name, $config) public function render($ns, $directive, $value, $name, $config)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
// this should probably be split up a little // this should probably be split up a little
$ret = ''; $ret = '';
$def = $config->def->info["$ns.$directive"]; $def = $config->def->info["$ns.$directive"];
if (is_int($def)) { if (is_int($def)) {
$type = abs($def); $type = abs($def);
} else { } else {
$type = $def->type; $type = $def->type;
} }
if (is_array($value)) { if (is_array($value)) {
switch ($type) { switch ($type) {
case HTMLPurifier_VarParser::LOOKUP: case HTMLPurifier_VarParser::LOOKUP:
$array = $value; $array = $value;
$value = array(); $value = array();
foreach ($array as $val => $b) { foreach ($array as $val => $b) {
$value[] = $val; $value[] = $val;
} }
//TODO does this need a break? //TODO does this need a break?
case HTMLPurifier_VarParser::ALIST: case HTMLPurifier_VarParser::ALIST:
$value = implode(PHP_EOL, $value); $value = implode(PHP_EOL, $value);
break; break;
case HTMLPurifier_VarParser::HASH: case HTMLPurifier_VarParser::HASH:
$nvalue = ''; $nvalue = '';
foreach ($value as $i => $v) { foreach ($value as $i => $v) {
if (is_array($v)) { if (is_array($v)) {
// HACK // HACK
$v = implode(";", $v); $v = implode(";", $v);
} }
$nvalue .= "$i:$v" . PHP_EOL; $nvalue .= "$i:$v" . PHP_EOL;
} }
$value = $nvalue; $value = $nvalue;
break; break;
default: default:
$value = ''; $value = '';
} }
} }
if ($type === HTMLPurifier_VarParser::C_MIXED) { if ($type === HTMLPurifier_VarParser::C_MIXED) {
return 'Not supported'; return 'Not supported';
$value = serialize($value); $value = serialize($value);
} }
$attr = array( $attr = array(
'name' => "$name" . "[$ns.$directive]", 'name' => "$name" . "[$ns.$directive]",
'id' => "$name:$ns.$directive" 'id' => "$name:$ns.$directive"
); );
if ($value === null) { if ($value === null) {
$attr['disabled'] = 'disabled'; $attr['disabled'] = 'disabled';
} }
if (isset($def->allowed)) { if (isset($def->allowed)) {
$ret .= $this->start('select', $attr); $ret .= $this->start('select', $attr);
foreach ($def->allowed as $val => $b) { foreach ($def->allowed as $val => $b) {
$attr = array(); $attr = array();
if ($value == $val) { if ($value == $val) {
$attr['selected'] = 'selected'; $attr['selected'] = 'selected';
} }
$ret .= $this->element('option', $val, $attr); $ret .= $this->element('option', $val, $attr);
} }
$ret .= $this->end('select'); $ret .= $this->end('select');
} elseif ($type === HTMLPurifier_VarParser::TEXT || } elseif ($type === HTMLPurifier_VarParser::TEXT ||
$type === HTMLPurifier_VarParser::ITEXT || $type === HTMLPurifier_VarParser::ITEXT ||
$type === HTMLPurifier_VarParser::ALIST || $type === HTMLPurifier_VarParser::ALIST ||
$type === HTMLPurifier_VarParser::HASH || $type === HTMLPurifier_VarParser::HASH ||
$type === HTMLPurifier_VarParser::LOOKUP) { $type === HTMLPurifier_VarParser::LOOKUP) {
$attr['cols'] = $this->cols; $attr['cols'] = $this->cols;
$attr['rows'] = $this->rows; $attr['rows'] = $this->rows;
$ret .= $this->start('textarea', $attr); $ret .= $this->start('textarea', $attr);
$ret .= $this->text($value); $ret .= $this->text($value);
$ret .= $this->end('textarea'); $ret .= $this->end('textarea');
} else { } else {
$attr['value'] = $value; $attr['value'] = $value;
$attr['type'] = 'text'; $attr['type'] = 'text';
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
} }
return $ret; return $ret;
} }
} }
/** /**
* Bool form field printer * Bool form field printer
*/ */
class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer
{ {
/** /**
* @param string $ns * @param string $ns
* @param string $directive * @param string $directive
* @param string $value * @param string $value
* @param string $name * @param string $name
* @param HTMLPurifier_Config|array $config * @param HTMLPurifier_Config|array $config
* @return string * @return string
*/ */
public function render($ns, $directive, $value, $name, $config) public function render($ns, $directive, $value, $name, $config)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
$ret = ''; $ret = '';
$ret .= $this->start('div', array('id' => "$name:$ns.$directive")); $ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
$ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Yes'); $ret .= $this->text(' Yes');
$ret .= $this->end('label'); $ret .= $this->end('label');
$attr = array( $attr = array(
'type' => 'radio', 'type' => 'radio',
'name' => "$name" . "[$ns.$directive]", 'name' => "$name" . "[$ns.$directive]",
'id' => "$name:Yes_$ns.$directive", 'id' => "$name:Yes_$ns.$directive",
'value' => '1' 'value' => '1'
); );
if ($value === true) { if ($value === true) {
$attr['checked'] = 'checked'; $attr['checked'] = 'checked';
} }
if ($value === null) { if ($value === null) {
$attr['disabled'] = 'disabled'; $attr['disabled'] = 'disabled';
} }
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
$ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' No'); $ret .= $this->text(' No');
$ret .= $this->end('label'); $ret .= $this->end('label');
$attr = array( $attr = array(
'type' => 'radio', 'type' => 'radio',
'name' => "$name" . "[$ns.$directive]", 'name' => "$name" . "[$ns.$directive]",
'id' => "$name:No_$ns.$directive", 'id' => "$name:No_$ns.$directive",
'value' => '0' 'value' => '0'
); );
if ($value === false) { if ($value === false) {
$attr['checked'] = 'checked'; $attr['checked'] = 'checked';
} }
if ($value === null) { if ($value === null) {
$attr['disabled'] = 'disabled'; $attr['disabled'] = 'disabled';
} }
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
$ret .= $this->end('div'); $ret .= $this->end('div');
return $ret; return $ret;
} }
} }
// vim: et sw=4 sts=4 // vim: et sw=4 sts=4
@@ -1,324 +1,324 @@
<?php <?php
class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
{ {
/** /**
* @type HTMLPurifier_HTMLDefinition, for easy access * @type HTMLPurifier_HTMLDefinition, for easy access
*/ */
protected $def; protected $def;
/** /**
* @param HTMLPurifier_Config $config * @param HTMLPurifier_Config $config
* @return string * @return string
*/ */
public function render($config) public function render($config)
{ {
$ret = ''; $ret = '';
$this->config =& $config; $this->config =& $config;
$this->def = $config->getHTMLDefinition(); $this->def = $config->getHTMLDefinition();
$ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));
$ret .= $this->renderDoctype(); $ret .= $this->renderDoctype();
$ret .= $this->renderEnvironment(); $ret .= $this->renderEnvironment();
$ret .= $this->renderContentSets(); $ret .= $this->renderContentSets();
$ret .= $this->renderInfo(); $ret .= $this->renderInfo();
$ret .= $this->end('div'); $ret .= $this->end('div');
return $ret; return $ret;
} }
/** /**
* Renders the Doctype table * Renders the Doctype table
* @return string * @return string
*/ */
protected function renderDoctype() protected function renderDoctype()
{ {
$doctype = $this->def->doctype; $doctype = $this->def->doctype;
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Doctype'); $ret .= $this->element('caption', 'Doctype');
$ret .= $this->row('Name', $doctype->name); $ret .= $this->row('Name', $doctype->name);
$ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No');
$ret .= $this->row('Default Modules', implode(', ', $doctype->modules)); $ret .= $this->row('Default Modules', implode(', ', $doctype->modules));
$ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules)); $ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules));
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders environment table, which is miscellaneous info * Renders environment table, which is miscellaneous info
* @return string * @return string
*/ */
protected function renderEnvironment() protected function renderEnvironment()
{ {
$def = $this->def; $def = $this->def;
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Environment'); $ret .= $this->element('caption', 'Environment');
$ret .= $this->row('Parent of fragment', $def->info_parent); $ret .= $this->row('Parent of fragment', $def->info_parent);
$ret .= $this->renderChildren($def->info_parent_def->child); $ret .= $this->renderChildren($def->info_parent_def->child);
$ret .= $this->row('Block wrap name', $def->info_block_wrapper); $ret .= $this->row('Block wrap name', $def->info_block_wrapper);
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Global attributes'); $ret .= $this->element('th', 'Global attributes');
$ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0); $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0);
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Tag transforms'); $ret .= $this->element('th', 'Tag transforms');
$list = array(); $list = array();
foreach ($def->info_tag_transform as $old => $new) { foreach ($def->info_tag_transform as $old => $new) {
$new = $this->getClass($new, 'TagTransform_'); $new = $this->getClass($new, 'TagTransform_');
$list[] = "<$old> with $new"; $list[] = "<$old> with $new";
} }
$ret .= $this->element('td', $this->listify($list)); $ret .= $this->element('td', $this->listify($list));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform'); $ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform'); $ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders the Content Sets table * Renders the Content Sets table
* @return string * @return string
*/ */
protected function renderContentSets() protected function renderContentSets()
{ {
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Content Sets'); $ret .= $this->element('caption', 'Content Sets');
foreach ($this->def->info_content_sets as $name => $lookup) { foreach ($this->def->info_content_sets as $name => $lookup) {
$ret .= $this->heavyHeader($name); $ret .= $this->heavyHeader($name);
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($lookup)); $ret .= $this->element('td', $this->listifyTagLookup($lookup));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders the Elements ($info) table * Renders the Elements ($info) table
* @return string * @return string
*/ */
protected function renderInfo() protected function renderInfo()
{ {
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Elements ($info)'); $ret .= $this->element('caption', 'Elements ($info)');
ksort($this->def->info); ksort($this->def->info);
$ret .= $this->heavyHeader('Allowed tags', 2); $ret .= $this->heavyHeader('Allowed tags', 2);
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
foreach ($this->def->info as $name => $def) { foreach ($this->def->info as $name => $def) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Inline content'); $ret .= $this->element('th', 'Inline content');
$ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No');
$ret .= $this->end('tr'); $ret .= $this->end('tr');
if (!empty($def->excludes)) { if (!empty($def->excludes)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Excludes'); $ret .= $this->element('th', 'Excludes');
$ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); $ret .= $this->element('td', $this->listifyTagLookup($def->excludes));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
if (!empty($def->attr_transform_pre)) { if (!empty($def->attr_transform_pre)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform'); $ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
if (!empty($def->attr_transform_post)) { if (!empty($def->attr_transform_post)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform'); $ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
if (!empty($def->auto_close)) { if (!empty($def->auto_close)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Auto closed by'); $ret .= $this->element('th', 'Auto closed by');
$ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Allowed attributes'); $ret .= $this->element('th', 'Allowed attributes');
$ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0);
$ret .= $this->end('tr'); $ret .= $this->end('tr');
if (!empty($def->required_attr)) { if (!empty($def->required_attr)) {
$ret .= $this->row('Required attributes', $this->listify($def->required_attr)); $ret .= $this->row('Required attributes', $this->listify($def->required_attr));
} }
$ret .= $this->renderChildren($def->child); $ret .= $this->renderChildren($def->child);
} }
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders a row describing the allowed children of an element * Renders a row describing the allowed children of an element
* @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element
* @return string * @return string
*/ */
protected function renderChildren($def) protected function renderChildren($def)
{ {
$context = new HTMLPurifier_Context(); $context = new HTMLPurifier_Context();
$ret = ''; $ret = '';
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$elements = array(); $elements = array();
$attr = array(); $attr = array();
if (isset($def->elements)) { if (isset($def->elements)) {
if ($def->type == 'strictblockquote') { if ($def->type == 'strictblockquote') {
$def->validateChildren(array(), $this->config, $context); $def->validateChildren(array(), $this->config, $context);
} }
$elements = $def->elements; $elements = $def->elements;
} }
if ($def->type == 'chameleon') { if ($def->type == 'chameleon') {
$attr['rowspan'] = 2; $attr['rowspan'] = 2;
} elseif ($def->type == 'empty') { } elseif ($def->type == 'empty') {
$elements = array(); $elements = array();
} elseif ($def->type == 'table') { } elseif ($def->type == 'table') {
$elements = array_flip( $elements = array_flip(
array( array(
'col', 'col',
'caption', 'caption',
'colgroup', 'colgroup',
'thead', 'thead',
'tfoot', 'tfoot',
'tbody', 'tbody',
'tr' 'tr'
) )
); );
} }
$ret .= $this->element('th', 'Allowed children', $attr); $ret .= $this->element('th', 'Allowed children', $attr);
if ($def->type == 'chameleon') { if ($def->type == 'chameleon') {
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>Block</em>: ' . '<em>Block</em>: ' .
$this->escape($this->listifyTagLookup($def->block->elements)), $this->escape($this->listifyTagLookup($def->block->elements)),
null, null,
0 0
); );
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>Inline</em>: ' . '<em>Inline</em>: ' .
$this->escape($this->listifyTagLookup($def->inline->elements)), $this->escape($this->listifyTagLookup($def->inline->elements)),
null, null,
0 0
); );
} elseif ($def->type == 'custom') { } elseif ($def->type == 'custom') {
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>' . ucfirst($def->type) . '</em>: ' . '<em>' . ucfirst($def->type) . '</em>: ' .
$def->dtd_regex $def->dtd_regex
); );
} else { } else {
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>' . ucfirst($def->type) . '</em>: ' . '<em>' . ucfirst($def->type) . '</em>: ' .
$this->escape($this->listifyTagLookup($elements)), $this->escape($this->listifyTagLookup($elements)),
null, null,
0 0
); );
} }
$ret .= $this->end('tr'); $ret .= $this->end('tr');
return $ret; return $ret;
} }
/** /**
* Listifies a tag lookup table. * Listifies a tag lookup table.
* @param array $array Tag lookup array in form of array('tagname' => true) * @param array $array Tag lookup array in form of array('tagname' => true)
* @return string * @return string
*/ */
protected function listifyTagLookup($array) protected function listifyTagLookup($array)
{ {
ksort($array); ksort($array);
$list = array(); $list = array();
foreach ($array as $name => $discard) { foreach ($array as $name => $discard) {
if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { if ($name !== '#PCDATA' && !isset($this->def->info[$name])) {
continue; continue;
} }
$list[] = $name; $list[] = $name;
} }
return $this->listify($list); return $this->listify($list);
} }
/** /**
* Listifies a list of objects by retrieving class names and internal state * Listifies a list of objects by retrieving class names and internal state
* @param array $array List of objects * @param array $array List of objects
* @return string * @return string
* @todo Also add information about internal state * @todo Also add information about internal state
*/ */
protected function listifyObjectList($array) protected function listifyObjectList($array)
{ {
ksort($array); ksort($array);
$list = array(); $list = array();
foreach ($array as $obj) { foreach ($array as $obj) {
$list[] = $this->getClass($obj, 'AttrTransform_'); $list[] = $this->getClass($obj, 'AttrTransform_');
} }
return $this->listify($list); return $this->listify($list);
} }
/** /**
* Listifies a hash of attributes to AttrDef classes * Listifies a hash of attributes to AttrDef classes
* @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)
* @return string * @return string
*/ */
protected function listifyAttr($array) protected function listifyAttr($array)
{ {
ksort($array); ksort($array);
$list = array(); $list = array();
foreach ($array as $name => $obj) { foreach ($array as $name => $obj) {
if ($obj === false) { if ($obj === false) {
continue; continue;
} }
$list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>'; $list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>';
} }
return $this->listify($list); return $this->listify($list);
} }
/** /**
* Creates a heavy header row * Creates a heavy header row
* @param string $text * @param string $text
* @param int $num * @param int $num
* @return string * @return string
*/ */
protected function heavyHeader($text, $num = 1) protected function heavyHeader($text, $num = 1)
{ {
$ret = ''; $ret = '';
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
return $ret; return $ret;
} }
} }
// vim: et sw=4 sts=4 // vim: et sw=4 sts=4
+12
View File
@@ -1,8 +1,12 @@
<?php <?php
include_once('./_common.php'); include_once('./_common.php');
require_once (dirname(__FILE__) .'/libs/KISA_SEED_CBC.php');
require_once (dirname(__FILE__) .'/libs/INILib.php');
$txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : ''; $txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : '';
$mid = substr($txId, 6, 10); $mid = substr($txId, 6, 10);
$SEEDKEY = isset($_POST['token']) ? clean_xss_tags($_POST['token'], 1, 1) : '';
$SEEDIV = 'SASHOSTSIRIAS000';
if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") { if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
@@ -41,6 +45,14 @@ if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
$birth_day = $res_data['userBirthday']; // 생년월일 $birth_day = $res_data['userBirthday']; // 생년월일
$ci = $res_data['userCi']; // CI $ci = $res_data['userCi']; // CI
if (defined('KGINICIS_USE_CERT_SEED') && KGINICIS_USE_CERT_SEED) {
// 개인정보SEED 암호화 된것을 복호화 합니다.
$user_name = decrypt_SEED($user_name, $SEEDKEY, $SEEDIV);
$phone_no = decrypt_SEED($phone_no, $SEEDKEY, $SEEDIV);
$birth_day = decrypt_SEED($birth_day, $SEEDKEY, $SEEDIV);
$ci = decrypt_SEED($ci, $SEEDKEY, $SEEDIV);
}
@insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록 @insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록
if(!$phone_no) if(!$phone_no)
+4 -3
View File
@@ -9,15 +9,16 @@ if(empty($max_cr_id)) $max_cr_id = 0;
if($config['cf_cert_use'] == 2) { // 실서비스 일때 if($config['cf_cert_use'] == 2) { // 실서비스 일때
$mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의) $mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey $apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
$mTxId ='SIR_'.$max_cr_id; $mTxId ='SIR_'.substr($max_cr_id.'_'.round(microtime(true) * 1000), 0, 16);
certify_count_check($member['mb_id'], 'simple'); // 금일 인증시도 횟수 체크 certify_count_check($member['mb_id'], 'simple'); // 금일 인증시도 횟수 체크
} else { // 테스트 일때 } else { // 테스트 일때
$mid = "SRAiasTest"; $mid = "SRAiasTest";
$apiKey = "43700dfd4c795fe9550853aef3b6aaf1"; $apiKey = "43700dfd4c795fe9550853aef3b6aaf1";
$mTxId ='SIR_'.$max_cr_id; $mTxId ='SIR_'.substr($max_cr_id.'_'.round(microtime(true) * 1000), 0, 16);
} }
$reqSvcCd ='01'; // 요청구분코드 ["01":간편인증, "02":전자서명] $reqSvcCd ='01'; // 요청구분코드 ["01":간편인증, "02":전자서명]
$reservedMsg ='isUseToken=Y'; // 결과조회 응답시 개인정보SEED 암호화 처리 요청 $reservedMsg = (defined('KGINICIS_USE_CERT_SEED') && KGINICIS_USE_CERT_SEED) ? 'isUseToken=Y' : ''; // 결과조회 응답시 개인정보SEED 암호화 처리 요청
// 등록가맹점 확인 // 등록가맹점 확인
$plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey); $plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey);
+8 -6
View File
@@ -6,7 +6,7 @@ require_once (dirname(__FILE__) .'/libs/INILib.php');
$txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : ''; $txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : '';
$mid = substr($txId, 6, 10); $mid = substr($txId, 6, 10);
$SEEDKEY = isset($_POST['token']) ? clean_xss_tags($_POST['token'], 1, 1) : ''; $SEEDKEY = isset($_POST['token']) ? clean_xss_tags($_POST['token'], 1, 1) : '';
$SEEDIV = "SASKGINICIS00000"; $SEEDIV = 'SASHOSTSIRIAS000';
if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") { if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
@@ -54,11 +54,13 @@ if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
$birth_day = $res_data['userBirthday']; // 생년월일 $birth_day = $res_data['userBirthday']; // 생년월일
$ci = $res_data['userCi']; // CI $ci = $res_data['userCi']; // CI
// 개인정보SEED 암호화 된것을 복호화 합니다. if (defined('KGINICIS_USE_CERT_SEED') && KGINICIS_USE_CERT_SEED) {
$user_name = decrypt_SEED($user_name, $SEEDKEY, $SEEDIV); // 개인정보SEED 암호화 된것을 복호화 합니다.
$phone_no = decrypt_SEED($phone_no, $SEEDKEY, $SEEDIV); $user_name = decrypt_SEED($user_name, $SEEDKEY, $SEEDIV);
$birth_day = decrypt_SEED($birth_day, $SEEDKEY, $SEEDIV); $phone_no = decrypt_SEED($phone_no, $SEEDKEY, $SEEDIV);
$ci = decrypt_SEED($ci, $SEEDKEY, $SEEDIV); $birth_day = decrypt_SEED($birth_day, $SEEDKEY, $SEEDIV);
$ci = decrypt_SEED($ci, $SEEDKEY, $SEEDIV);
}
@insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록 @insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록
+2 -1
View File
@@ -67,10 +67,11 @@ function decrypt_SEED($str, $bszUser_key, $bszIV) {
$pdwRoundKey = array_pad(array(), 32, 0); $pdwRoundKey = array_pad(array(), 32, 0);
$bszPlainText = null; $bszPlainText = null;
$planBytresMessage = array();
// 방법 1 // 방법 1
$bszPlainText = KISA_SEED_CBC::SEED_CBC_Decrypt($keyBytes, $IVBytes, $planBytes, 0, count($planBytes)); $bszPlainText = KISA_SEED_CBC::SEED_CBC_Decrypt($keyBytes, $IVBytes, $planBytes, 0, count($planBytes));
for ($i = 0; $i < sizeof($bszPlainText); $i++) { for ($i = 0; $i < sizeof((array) $bszPlainText); $i++) {
$planBytresMessage[] = sprintf("%02X", $bszPlainText[$i]); $planBytresMessage[] = sprintf("%02X", $bszPlainText[$i]);
} }
return Hex2String($planBytresMessage); return Hex2String($planBytresMessage);
+3 -2
View File
@@ -171,7 +171,7 @@ if (!defined('_KISA_SEED_KEY_')) {
var $key_data = null; var $key_data = null;
function KISA_SEED_KEY() { function __construct() {
$this->key_data = array_pad(array(), 32, 0); $this->key_data = array_pad(array(), 32, 0);
} }
@@ -192,7 +192,7 @@ if (!defined('_KISA_SEED_INFO_')) {
var $cbc_last_block = null; var $cbc_last_block = null;
var $last_block_flag = 0; var $last_block_flag = 0;
function KISA_SEED_INFO() { function __construct() {
$this->ivec = array_pad(array(), 4, 0); $this->ivec = array_pad(array(), 4, 0);
$this->seed_key = new KISA_SEED_KEY(); $this->seed_key = new KISA_SEED_KEY();
$this->cbc_buffer = array_pad(array(), 4, 0); $this->cbc_buffer = array_pad(array(), 4, 0);
@@ -782,6 +782,7 @@ class KISA_SEED_CBC {
$pbszCipherText = array_pad(array(), $message_length, 0); $pbszCipherText = array_pad(array(), $message_length, 0);
Common::arraycopy_system($message, $message_offset, $pbszCipherText, 0, $message_length); Common::arraycopy_system($message, $message_offset, $pbszCipherText, 0, $message_length);
$nCipherTextLen = count($pbszCipherText); $nCipherTextLen = count($pbszCipherText);
$result = null;
if ($nCipherTextLen % KISA_SEED_CBC::BLOCK_SIZE_SEED) { if ($nCipherTextLen % KISA_SEED_CBC::BLOCK_SIZE_SEED) {
return $result; return $result;
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -14,12 +14,15 @@ $web_siteid = '';
if ($config['cf_cert_use'] == 2) { // 실서비스 if ($config['cf_cert_use'] == 2) { // 실서비스
$site_cd = 'SM'.$config['cf_cert_kcp_cd']; $site_cd = 'SM'.$config['cf_cert_kcp_cd'];
$cert_url = 'https://cert.kcp.co.kr/kcp_cert/cert_view.jsp'; $cert_url = 'https://cert.kcp.co.kr/kcp_cert/cert_view.jsp';
$kcp_enc_key = $config['cf_cert_kcp_enckey'];
} else if ($config['cf_cert_use'] == 1) { // 테스트사용 } else if ($config['cf_cert_use'] == 1) { // 테스트사용
$site_cd = 'S6186'; $site_cd = 'S6186';
$cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp'; $cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp';
$kcp_enc_key = 'E66DCEB95BFBD45DF9DFAEEBCB092B5DC2EB3BF0';
} else { // 사용안함 } else { // 사용안함
$site_cd = ''; $site_cd = '';
$cert_url = ''; $cert_url = '';
$kcp_enc_key = '';
} }
if(!$site_cd) if(!$site_cd)
+11 -1
View File
@@ -27,6 +27,8 @@ if(!$ordr_idxx)
$ct_cert = new C_CT_CLI; $ct_cert = new C_CT_CLI;
$ct_cert->mf_clear(); $ct_cert->mf_clear();
$sbParam = '';
$year = "00"; $year = "00";
$month = "00"; $month = "00";
$day = "00"; $day = "00";
@@ -47,7 +49,7 @@ $hash_data = $site_cd .
$sex_code . $sex_code .
$local_code; $local_code;
$up_hash = $ct_cert->make_hash_data( $home_dir, $hash_data ); $up_hash = $ct_cert->make_hash_data( $home_dir, $kcp_enc_key, $hash_data );
$ct_cert->mf_clear(); $ct_cert->mf_clear();
?> ?>
@@ -88,6 +90,9 @@ $ct_cert->mf_clear();
<!-- cert_enc_use 필수 (고정값 : 메뉴얼 참고) --> <!-- cert_enc_use 필수 (고정값 : 메뉴얼 참고) -->
<input type="hidden" name="cert_enc_use" value="Y"/> <input type="hidden" name="cert_enc_use" value="Y"/>
<!-- 리턴 암호화 고도화 -->
<input type="hidden" name="cert_enc_use_ext" value="Y"/>
<?php if(is_mobile()) { ?> <?php if(is_mobile()) { ?>
<!-- cert_able_yn input 비활성화 설정 --> <!-- cert_able_yn input 비활성화 설정 -->
<input type="hidden" name="cert_able_yn" value=""/> <input type="hidden" name="cert_able_yn" value=""/>
@@ -101,10 +106,15 @@ $ct_cert->mf_clear();
<!-- up_hash 검증 을 위한 필드 --> <!-- up_hash 검증 을 위한 필드 -->
<input type="hidden" name="veri_up_hash" value=""/> <input type="hidden" name="veri_up_hash" value=""/>
<!-- web_siteid 을 위한 필드 -->
<input type="hidden" name="web_siteid_hashYN" value=""/>
<!-- 가맹점 사용 필드 (인증완료시 리턴)--> <!-- 가맹점 사용 필드 (인증완료시 리턴)-->
<input type="hidden" name="param_opt_1" value="opt1"/> <input type="hidden" name="param_opt_1" value="opt1"/>
<input type="hidden" name="param_opt_2" value="opt2"/> <input type="hidden" name="param_opt_2" value="opt2"/>
<input type="hidden" name="param_opt_3" value="opt3"/> <input type="hidden" name="param_opt_3" value="opt3"/>
<input type='hidden' name='kcp_cert_lib_ver' value="<?php echo $ct_cert->get_kcp_lib_ver( $home_dir ); ?>"/>
</form> </form>
<script> <script>
+8 -2
View File
@@ -12,6 +12,7 @@ $enc_data = "";
$req_tx = ""; $req_tx = "";
$enc_cert_data = ""; $enc_cert_data = "";
$enc_cert_data2 = "";
$cert_info = ""; $cert_info = "";
$tran_cd = ""; $tran_cd = "";
@@ -67,6 +68,11 @@ for($i=0; $i<count($key); $i++)
{ {
$enc_cert_data = f_get_parm_str ( $valParam ); $enc_cert_data = f_get_parm_str ( $valParam );
} }
if ( $nmParam == "enc_cert_data2" )
{
$enc_cert_data2 = f_get_parm_str ( $valParam );
}
if ( $nmParam == "dn_hash" ) if ( $nmParam == "dn_hash" )
{ {
@@ -98,7 +104,7 @@ if( $cert_enc_use == "Y" )
// 해당 데이터의 위변조를 방지합니다 // 해당 데이터의 위변조를 방지합니다
$veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호 $veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호
if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" ) if ( $ct_cert->check_valid_hash ( $home_dir , $kcp_enc_key, $dn_hash , $veri_str ) != "1" )
{ {
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
// 검증 실패시 처리 영역 // 검증 실패시 처리 영역
@@ -122,7 +128,7 @@ if( $cert_enc_use == "Y" )
// site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다. // site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다.
// 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다. // 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다.
$opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" ) $opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" )
$ct_cert->decrypt_enc_cert( $home_dir , $site_cd , $cert_no , $enc_cert_data , $opt ); $ct_cert->decrypt_enc_cert( $home_dir , $kcp_enc_key, $site_cd , $cert_no , $enc_cert_data2 , $opt );
$comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드 $comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드
$phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호 $phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호
+27 -3
View File
@@ -20,7 +20,7 @@ class C_CT_CLI
} }
// hash 처리 영역 // hash 처리 영역
function make_hash_data( $home_dir , $str ) function make_hash_data( $home_dir , $key , $str )
{ {
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if(PHP_INT_MAX == 2147483647) // 32-bit if(PHP_INT_MAX == 2147483647) // 32-bit
@@ -32,6 +32,7 @@ class C_CT_CLI
} }
$hash_data = $this -> mf_exec( $bin_exe , $hash_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__make_hash_data", "lf_CT_CLI__make_hash_data",
$key,
$str $str
); );
@@ -41,7 +42,7 @@ class C_CT_CLI
} }
// dn_hash 체크 함수 // dn_hash 체크 함수
function check_valid_hash ($home_dir , $hash_data , $str ) function check_valid_hash ($home_dir , $key , $hash_data , $str )
{ {
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if(PHP_INT_MAX == 2147483647) // 32-bit if(PHP_INT_MAX == 2147483647) // 32-bit
@@ -53,6 +54,7 @@ class C_CT_CLI
} }
$ret_val = $this -> mf_exec( $bin_exe , $ret_val = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__check_valid_hash" , "lf_CT_CLI__check_valid_hash" ,
$key,
$hash_data , $hash_data ,
$str $str
); );
@@ -63,7 +65,7 @@ class C_CT_CLI
} }
// 암호화 인증데이터 복호화 // 암호화 인증데이터 복호화
function decrypt_enc_cert ( $home_dir, $site_cd , $cert_no , $enc_cert_data , $opt) function decrypt_enc_cert ( $home_dir, $key , $site_cd , $cert_no , $enc_cert_data , $opt)
{ {
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if(PHP_INT_MAX == 2147483647) // 32-bit if(PHP_INT_MAX == 2147483647) // 32-bit
@@ -73,6 +75,7 @@ class C_CT_CLI
$dec_data = $this -> mf_exec( $bin_exe , $dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" , "lf_CT_CLI__decrypt_enc_cert" ,
$key,
$site_cd , $site_cd ,
$cert_no , $cert_no ,
$enc_cert_data , $enc_cert_data ,
@@ -84,6 +87,7 @@ class C_CT_CLI
$dec_data = $this -> mf_exec( $bin_exe , $dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" , "lf_CT_CLI__decrypt_enc_cert" ,
$key,
$site_cd , $site_cd ,
$cert_no , $cert_no ,
$enc_cert_data $enc_cert_data
@@ -96,6 +100,26 @@ class C_CT_CLI
parse_str( str_replace( chr( 31 ), "&", $dec_data ), $this->m_dec_data ); parse_str( str_replace( chr( 31 ), "&", $dec_data ), $this->m_dec_data );
} }
function get_kcp_lib_ver( $home_dir )
{
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = $home_dir . '/bin/ct_cli';
else
$bin_exe = $home_dir . '/bin/ct_cli_x64';
} else {
$bin_exe = $home_dir . '/bin/ct_cli_exe.exe';
}
$ver_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__get_kcp_lib_ver"
);
if ( $ver_data == "" ) { $ver_data = "HS04"; }
return $ver_data;
}
// 인증데이터 get data // 인증데이터 get data
function mf_get_key_value( $name ) function mf_get_key_value( $name )
{ {
+1 -1
View File
@@ -111,7 +111,7 @@ $_SESSION['lgd_certify'] = $payReqMap;
<title>LG유플러스 전자결제 본인확인서비스</title> <title>LG유플러스 전자결제 본인확인서비스</title>
<!-- 고객사 사이트가 https인 경우는 아래 http://을 https:// 으로 변경하시면 됩니다. --> <!-- 고객사 사이트가 https인 경우는 아래 http://을 https:// 으로 변경하시면 됩니다. -->
<link rel="stylesheet" href="<?php echo G5_CSS_URL;?>/default.css"> <link rel="stylesheet" href="<?php echo G5_CSS_URL;?>/default.css">
<script language="javascript" src="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https' : 'http'; ?>://xpay.uplus.co.kr/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://xpay.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
+2 -3
View File
@@ -1,3 +1,2 @@
url = https://xpayclient.lgdacom.net/xpay/Gateway.do url = https://xpay-gateway.tosspayments.com/xpay/Gateway.do
test_url = https://pretestclient.uplus.co.kr:9443/xpay/Gateway.do test_url = https://xpay-gateway-sandbox.tosspayments.com/xpay/Gateway.do
aux_url = http://xpayclient.lgdacom.net:7080/xpay/Gateway.do
+3 -2
View File
@@ -20,8 +20,8 @@ class OAuth1Client{
public $redirect_uri = ""; public $redirect_uri = "";
public $decode_json = true; public $decode_json = true;
public $curl_time_out = 30; public $curl_time_out = 10;
public $curl_connect_time_out = 30; public $curl_connect_time_out = 15;
public $curl_ssl_verifypeer = false; public $curl_ssl_verifypeer = false;
public $curl_auth_header = true; public $curl_auth_header = true;
public $curl_useragent = "OAuth/1 Simple PHP Client v0.1; HybridAuth http://hybridauth.sourceforge.net/"; public $curl_useragent = "OAuth/1 Simple PHP Client v0.1; HybridAuth http://hybridauth.sourceforge.net/";
@@ -194,6 +194,7 @@ class OAuth1Client{
curl_setopt( $ci, CURLOPT_USERAGENT , $this->curl_useragent ); curl_setopt( $ci, CURLOPT_USERAGENT , $this->curl_useragent );
curl_setopt( $ci, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out ); curl_setopt( $ci, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out );
curl_setopt( $ci, CURLOPT_TIMEOUT , $this->curl_time_out ); curl_setopt( $ci, CURLOPT_TIMEOUT , $this->curl_time_out );
curl_setopt( $ci, CURLOPT_MAXREDIRS , 10);
curl_setopt( $ci, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ci, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ci, CURLOPT_HTTPHEADER , array('Expect:') ); curl_setopt( $ci, CURLOPT_HTTPHEADER , array('Expect:') );
curl_setopt( $ci, CURLOPT_SSL_VERIFYPEER, $this->curl_ssl_verifypeer ); curl_setopt( $ci, CURLOPT_SSL_VERIFYPEER, $this->curl_ssl_verifypeer );
+3 -2
View File
@@ -26,8 +26,8 @@ class OAuth2Client
//-- //--
public $sign_token_name = "access_token"; public $sign_token_name = "access_token";
public $curl_time_out = 30; public $curl_time_out = 10;
public $curl_connect_time_out = 30; public $curl_connect_time_out = 15;
public $curl_ssl_verifypeer = false; public $curl_ssl_verifypeer = false;
public $curl_ssl_verifyhost = false; public $curl_ssl_verifyhost = false;
public $curl_header = array(); public $curl_header = array();
@@ -221,6 +221,7 @@ class OAuth2Client
curl_setopt($ch, CURLOPT_TIMEOUT , $this->curl_time_out ); curl_setopt($ch, CURLOPT_TIMEOUT , $this->curl_time_out );
curl_setopt($ch, CURLOPT_USERAGENT , $this->curl_useragent ); curl_setopt($ch, CURLOPT_USERAGENT , $this->curl_useragent );
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , $this->curl_connect_time_out ); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , $this->curl_connect_time_out );
curl_setopt($ch, CURLOPT_MAXREDIRS , 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , $this->curl_ssl_verifypeer ); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , $this->curl_ssl_verifypeer );
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , $this->curl_ssl_verifyhost ); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , $this->curl_ssl_verifyhost );
curl_setopt($ch, CURLOPT_HTTPHEADER , $this->curl_header ); curl_setopt($ch, CURLOPT_HTTPHEADER , $this->curl_header );
+1 -1
View File
@@ -151,7 +151,7 @@ function social_before_join_check($url=''){
return false; return false;
} }
function social_get_data($by='provider', $provider, $user_profile){ function social_get_data($by, $provider, $user_profile){
global $g5; global $g5;
// 소셜 가입이 되어 있는지 체크 // 소셜 가입이 되어 있는지 체크
+6 -5
View File
@@ -148,7 +148,12 @@ else // 장바구니에 담기
$post_io_ids = (isset($_POST['io_id']) && is_array($_POST['io_id'])) ? $_POST['io_id'] : array(); $post_io_ids = (isset($_POST['io_id']) && is_array($_POST['io_id'])) ? $_POST['io_id'] : array();
$post_io_types = (isset($_POST['io_type']) && is_array($_POST['io_type'])) ? $_POST['io_type'] : array(); $post_io_types = (isset($_POST['io_type']) && is_array($_POST['io_type'])) ? $_POST['io_type'] : array();
$post_ct_qtys = (isset($_POST['ct_qty']) && is_array($_POST['ct_qty'])) ? $_POST['ct_qty'] : array(); $post_ct_qtys = (isset($_POST['ct_qty']) && is_array($_POST['ct_qty'])) ? $_POST['ct_qty'] : array();
if ($count && $sw_direct) {
// 바로구매에 있던 장바구니 자료를 지운다.
sql_query(" delete from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and ct_direct = 1 ", false);
}
for($i=0; $i<$count; $i++) { for($i=0; $i<$count; $i++) {
// 보관함의 상품을 담을 때 체크되지 않은 상품 건너뜀 // 보관함의 상품을 담을 때 체크되지 않은 상품 건너뜀
if($act == 'multi' && ! (isset($post_chk_it_id[$i]) && $post_chk_it_id[$i])) if($act == 'multi' && ! (isset($post_chk_it_id[$i]) && $post_chk_it_id[$i]))
@@ -180,10 +185,6 @@ else // 장바구니에 담기
if(!$it['it_id']) if(!$it['it_id'])
alert('상품정보가 존재하지 않습니다.'); alert('상품정보가 존재하지 않습니다.');
// 바로구매에 있던 장바구니 자료를 지운다.
if($i == 0 && $sw_direct)
sql_query(" delete from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and ct_direct = 1 ", false);
// 최소, 최대 수량 체크 // 최소, 최대 수량 체크
if($it['it_buy_min_qty'] || $it['it_buy_max_qty']) { if($it['it_buy_min_qty'] || $it['it_buy_max_qty']) {
$sum_qty = 0; $sum_qty = 0;
+16 -1
View File
@@ -146,7 +146,22 @@ if ( $req_tx == "pay" )
{ {
/* 1004원은 실제로 업체에서 결제하셔야 될 원 금액을 넣어주셔야 합니다. 결제금액 유효성 검증 */ /* 1004원은 실제로 업체에서 결제하셔야 될 원 금액을 넣어주셔야 합니다. 결제금액 유효성 검증 */
$c_PayPlus->mf_set_ordr_data( "ordr_mony", $good_mny ); $c_PayPlus->mf_set_ordr_data( "ordr_mony", $good_mny );
$kcp_pay_type = ''; // 결제수단 검증 파라미터 pay_type (신용카드 : PACA, 계좌이체 : PABK, 가상계좌 : PAVC, 휴대폰 : PAMC)
if ($use_pay_method == "100000000000" && (in_array($od_settle_case, array('신용카드', '간편결제')))) { // 신용카드
$kcp_pay_type = 'PACA';
} else if ($use_pay_method == "010000000000" && $od_settle_case === '계좌이체') { // 계좌이체
$kcp_pay_type = 'PABK';
} else if ($use_pay_method == "001000000000" && $od_settle_case === '가상계좌') { // 가상계좌
$kcp_pay_type = 'PAVC';
} else if ($use_pay_method == "000010000000" && $od_settle_case === '휴대폰') { // 휴대폰
$kcp_pay_type = 'PAMC';
}
$c_PayPlus->mf_set_ordr_data( "pay_type", $kcp_pay_type );
$c_PayPlus->mf_set_ordr_data( "ordr_no", $ordr_idxx );
$post_enc_data = isset($_POST['enc_data']) ? $_POST['enc_data'] : ''; $post_enc_data = isset($_POST['enc_data']) ? $_POST['enc_data'] : '';
$post_enc_info = isset($_POST['enc_info']) ? $_POST['enc_info'] : ''; $post_enc_info = isset($_POST['enc_info']) ? $_POST['enc_info'] : '';
+2 -2
View File
@@ -5,10 +5,10 @@ if($od['od_pg'] != 'lg') return;
if($default['de_card_test']) { if($default['de_card_test']) {
$mid = 'tsi_'.$config['cf_lg_mid']; $mid = 'tsi_'.$config['cf_lg_mid'];
$service_url = "http://pgweb.uplus.co.kr:7085/pg/wmp/mertadmin/jsp/escrow/rcvdlvinfo.jsp"; $service_url = "https://pgweb.tosspayments.com:9091/pg/wmp/mertadmin/jsp/escrow/rcvdlvinfo.jsp";
} else { } else {
$mid = 'si_'.$config['cf_lg_mid']; $mid = 'si_'.$config['cf_lg_mid'];
$service_url = "https://pgweb.uplus.co.kr/pg/wmp/mertadmin/jsp/escrow/rcvdlvinfo.jsp"; $service_url = "https://pgweb.tosspayments.com/pg/wmp/mertadmin/jsp/escrow/rcvdlvinfo.jsp";
} }
// 택배사코드 // 택배사코드
+2 -2
View File
@@ -6,9 +6,9 @@ if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use']
?> ?>
<?php if ($default['de_card_test']) { // 테스트 결제시 ?> <?php if ($default['de_card_test']) { // 테스트 결제시 ?>
<script language="javascript" src="https://pretest.uplus.co.kr:9443/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://js.tosspayments.com/xpay_crossplatform/sandbox/v1" type="text/javascript"></script>
<?php } else { //실 결제시 ?> <?php } else { //실 결제시 ?>
<script language="javascript" src="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https' : 'http'; ?>://xpay.uplus.co.kr/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://xpay.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
<?php } ?> <?php } ?>
<script type="text/javascript"> <script type="text/javascript">
-5
View File
@@ -36,8 +36,6 @@ try{
'CharSet' => 'utf-8' 'CharSet' => 'utf-8'
); );
if (function_exists('add_log')) add_log($data);
/* /*
**************************************************************************************** ****************************************************************************************
* <Cancel Request> * <Cancel Request>
@@ -46,9 +44,6 @@ try{
$response = nicepay_reqPost($data, "https://pg-api.nicepay.co.kr/webapi/cancel_process.jsp"); //Cancel API call $response = nicepay_reqPost($data, "https://pg-api.nicepay.co.kr/webapi/cancel_process.jsp"); //Cancel API call
$result = json_decode($response, true); $result = json_decode($response, true);
if (function_exists('add_log')) add_log(array('1'=>1));
if (function_exists('add_log')) add_log($result, true, 'cc');
}catch(Exception $e){ }catch(Exception $e){
$e->getMessage(); $e->getMessage();
-2
View File
@@ -12,8 +12,6 @@ if (! ($default['de_pg_service'] == 'nicepay' && $orderNumber)){
die(json_encode(array('error'=>'올바른 방법으로 이용해 주십시오.'))); die(json_encode(array('error'=>'올바른 방법으로 이용해 주십시오.')));
} }
if (function_exists('add_log')) add_log($_POST, false, 'ajax');
$price = preg_replace('#[^0-9]#', '', $_POST['price']); $price = preg_replace('#[^0-9]#', '', $_POST['price']);
if (strlen($price) < 1) { if (strlen($price) < 1) {
+6 -6
View File
@@ -5,6 +5,11 @@ if($od['od_pg'] != 'nicepay') return;
include_once(G5_SHOP_PATH.'/settle_nicepay.inc.php'); include_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');
if (!$escrow_numb) {
// 송장번호가 없으면 등록이 안된다.
return;
}
$mid = $default['de_nicepay_mid']; $mid = $default['de_nicepay_mid'];
$tid = $escrow_tno; // 거래 번호 $tid = $escrow_tno; // 거래 번호
$reqType = '03'; // 요청타입 (배송등록 03) $reqType = '03'; // 요청타입 (배송등록 03)
@@ -45,8 +50,6 @@ $response = nicepay_reqPost($data, $escrowRequestURL);
$nice_result = json_decode($response, true); $nice_result = json_decode($response, true);
if (function_exists('add_log')) add_log($nice_result, true, 'es');
// 성공이면 // 성공이면
if (isset($nice_result['ResultCode']) && $nice_result['ResultCode'] === 'C000') { if (isset($nice_result['ResultCode']) && $nice_result['ResultCode'] === 'C000') {
@@ -71,7 +74,4 @@ if (isset($nice_result['ResultCode']) && $nice_result['ResultCode'] === 'C000')
$resultCode = $nice_result['ResultCode']; // 결과코드 ("00"이면 지불 성공) $resultCode = $nice_result['ResultCode']; // 결과코드 ("00"이면 지불 성공)
$resultMsg = $nice_result['ResultMsg']; // 결과내용 (지불결과에 대한 설명) $resultMsg = $nice_result['ResultMsg']; // 결과내용 (지불결과에 대한 설명)
$dlv_date = $nice_result['ProcessDate']; $dlv_date = $nice_result['ProcessDate'];
$dlv_time = $nice_result['ProcessTime']; $dlv_time = $nice_result['ProcessTime'];
echo "에스크로배송";
exit;
-4
View File
@@ -4,8 +4,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 나이스페이 공통 설정 // 나이스페이 공통 설정
require_once(G5_SHOP_PATH.'/settle_nicepay.inc.php'); require_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');
if (function_exists('add_log')) add_log($_POST);
/* /*
**************************************************************************************** ****************************************************************************************
* <Authentication Result Parameter> * <Authentication Result Parameter>
@@ -113,8 +111,6 @@ if($authResultCode === "0000"){
} }
$respArr = json_decode($response, true); $respArr = json_decode($response, true);
if (function_exists('add_log')) add_log($respArr);
$ResultCode = nicepay_res('ResultCode', $respArr); $ResultCode = nicepay_res('ResultCode', $respArr);
$ResultMsg = nicepay_res('ResultMsg', $respArr); $ResultMsg = nicepay_res('ResultMsg', $respArr);
-2
View File
@@ -84,8 +84,6 @@ $response = nicepay_reqPost($data, "https://pg-api.nicepay.co.kr/webapi/cash_rec
$result = json_decode($response, true); $result = json_decode($response, true);
if (function_exists('add_log')) add_log($result, true, 'rr');
// 성공이면 // 성공이면
if (isset($result['ResultCode']) && $result['ResultCode'] === '7001') { if (isset($result['ResultCode']) && $result['ResultCode'] === '7001') {
+9 -1
View File
@@ -652,6 +652,10 @@ if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY': case 'KAKAOPAY':
$_REQUEST['TID'] = $tno; $_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount; $_REQUEST['Amt'] = $amount;
@@ -707,6 +711,10 @@ if(!$result) {
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY': case 'KAKAOPAY':
$_REQUEST['TID'] = $tno; $_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount; $_REQUEST['Amt'] = $amount;
@@ -814,7 +822,7 @@ if($config['cf_sms_use'] && ($default['de_sms_use2'] || $default['de_sms_use3'])
$sms_content = str_replace("{보낸분}", $od_name, $sms_content); $sms_content = str_replace("{보낸분}", $od_name, $sms_content);
$sms_content = str_replace("{받는분}", $od_b_name, $sms_content); $sms_content = str_replace("{받는분}", $od_b_name, $sms_content);
$sms_content = str_replace("{주문번호}", $od_id, $sms_content); $sms_content = str_replace("{주문번호}", $od_id, $sms_content);
$sms_content = str_replace("{주문금액}", number_format($tot_ct_price + $od_send_cost + $od_send_cost2), $sms_content); $sms_content = str_replace("{주문금액}", number_format($tot_ct_price + $od_send_cost + (int) $od_send_cost2), $sms_content);
$sms_content = str_replace("{회원아이디}", $member['mb_id'], $sms_content); $sms_content = str_replace("{회원아이디}", $member['mb_id'], $sms_content);
$sms_content = str_replace("{회사명}", $default['de_admin_company_name'], $sms_content); $sms_content = str_replace("{회사명}", $default['de_admin_company_name'], $sms_content);
-2
View File
@@ -1,8 +1,6 @@
<?php <?php
include_once('./_common.php'); include_once('./_common.php');
if (function_exists('add_log')) add_log($_POST, false, 'vv');
$NICEPAY_log_path = G5_DATA_PATH.'/log'; // 나이스페이 가상계좌 로그저장 경로 $NICEPAY_log_path = G5_DATA_PATH.'/log'; // 나이스페이 가상계좌 로그저장 경로
$NICEPAY_payLog = false; // 로그를 기록하려면 true 로 수정 $NICEPAY_payLog = false; // 로그를 기록하려면 true 로 수정
+1 -1
View File
@@ -2,7 +2,7 @@
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
define('G5_VERSION', '그누보드5'); define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.6'); define('G5_GNUBOARD_VER', '5.6.7');
// 그누보드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)
// G5_YOUNGCART_VER 이 상수를 사용하는 곳이 있으므로 주석 처리 해제함 // G5_YOUNGCART_VER 이 상수를 사용하는 곳이 있으므로 주석 처리 해제함
// 그누보드5.4.6 이상 버전 부터는 영카트를 그누보드에 포함하여 배포하므로 영카트5의 버전은 의미가 없습니다. // 그누보드5.4.6 이상 버전 부터는 영카트를 그누보드에 포함하여 배포하므로 영카트5의 버전은 의미가 없습니다.