Compare commits

...
108 Commits
Author SHA1 Message Date
thisgun aa88ff68a1 KG이니시스 IDC 센터코드 검증 추가2 2025-06-12 17:34:53 +09:00
thisgun 07a0245f85 버전 5.6.14 수정 2025-06-12 17:17:33 +09:00
thisgun d3de613a8c 관리자 로그인시 새글 테이블 OPIMIZE 실행시 딜레이 되는 문제 개선 2025-06-12 17:05:55 +09:00
thisgun bb1f69e86c KG이니시스 IDC 센터코드 검증 추가 2025-06-05 16:11:20 +09:00
thisgun dc4c2a79d9 XSS 취약점 수정 박재형님 제보 2025-06-05 14:12:55 +09:00
thisgun 38451a7d3d [KVE-2025-0384]XSS lead to RCE 취약점 수정 2025-06-04 17:44:50 +09:00
thisgun 87d11d5c78 변수 초기화 되지 않아 warning 메시지 출려되는 현상 수정 2025-06-04 14:40:18 +09:00
thisgun c1bbce1114 KG이니시스 가상계좌 에스크로 IP 추가 2025-05-28 11:27:59 +09:00
thisgun 61576d3e87 [KVE-2025-0351]ip 검증 취약점 수정 2025-05-28 10:57:33 +09:00
thisgun c9100d2e38 NHN_KCP 본인인증 테스트 오류 수정 2025-05-23 12:19:22 +09:00
thisgun 7714153faf 버전 5.6.13 수정 2025-05-15 15:31:41 +09:00
thisgun 654fd7ba68 방문자 기록 sql 문 수정 2025-05-15 15:30:40 +09:00
thisgun ea9f618de8 KG이니시스 모바일 가상계좌 IP 추가 2025-05-15 15:29:26 +09:00
thisgun eea5a2477b 쇼핑몰관리자 나이스페이신청 URL 링크 수정 2025-05-15 14:23:38 +09:00
thisgun 8cc101b617 접근차단 ip코드 다시 재수정 2025-05-15 14:09:27 +09:00
thisgun 316d3542a9 [KVE-2025-0259]XSS 취약점 수정 2025-05-15 09:53:28 +09:00
thisgun c2da219473 [KVE-2025-0286]XSS 취약점 수정 2025-05-14 12:49:03 +09:00
thisgun 6874e767c2 kcp 모바일 테스트결제 url 변경 2025-05-14 12:00:09 +09:00
thisgun 5a91d37365 php warning 메시지 코드 수정 2025-05-14 11:59:40 +09:00
thisgun f9c972d866 [KVE-2025-0191] Stored XSS (bypass html_purify via Open Redirect) 취약점 수정 2025-04-17 16:04:01 +09:00
thisgun ada8f28aae 버전 5.6.12 수정 2025-04-15 16:33:05 +09:00
thisgun 11afc52b84 접근차단 ip 코드의 위치 다시 재수정 2025-04-15 16:31:27 +09:00
thisgun d9c3f0e66c Merge branch 'master' of github.com:gnuboard/gnuboard5 2025-04-15 12:06:31 +09:00
thisgun 49da5c33df 버전 5.6.11 수정 2025-04-15 11:56:53 +09:00
thisgun 29250f264a 첩근차단 ip코드의 위치 수정 2025-04-15 11:44:40 +09:00
thisgun df00641290 php warning 메시지 코드 수정 2025-04-15 11:20:44 +09:00
thisgun a05a1403f5 Merge branch 'master' of github.com:gnuboard/g5-update 2025-04-15 10:52:11 +09:00
총 c5817594d0 [KVE-2025-0234] 관리자 XSS 취약점 수정 2025-04-15 10:11:31 +09:00
kagla 68a9e45337 Revert "경로 수정 및 불필요한 파일 삭제: CSS 파일 경로를 절대 경로로 변경하고, 사용되지 않는 install.css 및 이미지 파일을 삭제함. 또한, 여러 파일에서 include 경로를 수정하여 일관성을 유지함."
This reverts commit b8da0f0890.
2025-04-11 13:06:43 +09:00
kagla b8da0f0890 경로 수정 및 불필요한 파일 삭제: CSS 파일 경로를 절대 경로로 변경하고, 사용되지 않는 install.css 및 이미지 파일을 삭제함. 또한, 여러 파일에서 include 경로를 수정하여 일관성을 유지함. 2025-04-11 12:56:45 +09:00
thisgun 62ff45b31f php warning 메시지 코드 수정 2025-03-31 15:36:32 +09:00
thisgun 918ad48675 이미지 태그에 loading=lazy 가 있을경우 viewimagereisze 함수에서 width 속성을 추가하지 않도록 수정#355 2025-03-14 16:40:26 +09:00
thisgun e5128bf02e cheditor5 에 지도아이콘 제거 2025-02-20 12:52:39 +09:00
thisgun 0a0d6e7228 버전 5.6.10 수정 2025-02-04 11:17:21 +09:00
thisgun 69180914f8 쇼핑몰 가상계좌 정보(toss)에 은행이름이 하나 더 붙은 문제 수정 2025-02-04 11:01:41 +09:00
thisgun 5552fda906 사이드뷰에서 잘못된 닉네임 또는 이름이 출력되는 오류 수정 2025-02-04 10:49:01 +09:00
thisgun 13759821fe 메일 함수 예외 로그 추가 #354 2025-02-03 17:56:42 +09:00
thisgun 2e7843da56 php warning 메시지 코드 수정 2025-02-03 11:36:01 +09:00
thisgun 33ee904f60 버전 5.6.9 수정 2025-01-21 16:26:06 +09:00
thisgun 3e8bedb1e9 토스페이먼츠 (구)상점관리자 서비스 종료 관련 수정 #353 2025-01-21 16:24:42 +09:00
thisgun 4f3ad37bf4 쇼핑몰 택배업체 url 추가 및 수정 2025-01-15 16:07:02 +09:00
thisgun af92ea064e 버전 5.6.8 수정 2024-11-26 17:36:29 +09:00
thisgun dab5abb89a NHN_KCP 휴대폰 본인인증 인증키 입력없이 사용할수 있도록 적용 2024-11-26 17:33:04 +09:00
thisgun 8893b112fa 일부 특수문자가 mysql charset 이 uft8 인 경우 기록이 안되는 현상 수정 2024-11-21 11:58:55 +09:00
thisgun d65fa99e3c CloudFlare 환경과 적용에 대한 코드 다시 재수정 2024-11-04 16:13:43 +09:00
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
114 changed files with 29460 additions and 28759 deletions
+3
View File
@@ -0,0 +1,3 @@
# Gnuboard5 Security Policy
Please ask [https://sir.kr/security/.](https://sir.kr/co_qa)
+10 -1
View File
@@ -554,9 +554,18 @@ function admin_check_xss_params($params)
if (is_array($value)) {
admin_check_xss_params($value);
} else if ((preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/(onload|onerror)=.*/ius', $value))) || preg_match('/^(?=.*token\()(?=.*xmlhttprequest\()(?=.*send\().*$/im', $value) || (preg_match('/(onload|onerror|focus)=.*/ius', $value) && preg_match('/(eval|expression|exec|prompt)(\s*)\((.*)\)/ius', $value))) {
} else if (
(preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/on[a-z]+=*/ius', $value))) || preg_match('/^(?=.*token\()(?=.*xmlhttprequest\()(?=.*send\().*$/im', $value) ||
(preg_match('/(on[a-z]+|focus)=.*/ius', $value) && preg_match('/(eval|atob|fetch|expression|exec|prompt)(\s*)\((.*)\)/ius', $value))) {
alert('요청 쿼리에 잘못된 스크립트문장이 있습니다.\\nXSS 공격일수도 있습니다.', G5_URL);
die();
} else if (preg_match('/atob\s*\(\s*[\'"]?([a-zA-Z0-9+\/=]+)[\'"]?\s*\)/ius', $value, $matches)) {
$decoded = base64_decode($matches[1], true);
if ($decoded && preg_match('/(eval|fetch|script|alert|settimeout|setinterval)/ius', $decoded)) {
// error_log("Base64 XSS 시도 감지: key=$key, decoded=$decoded, IP=" . $_SERVER['REMOTE_ADDR']);
alert('Base64로 인코딩된 위험한 스크립트가 발견되었습니다.', G5_URL);
die();
}
}
}
+116 -6
View File
@@ -409,6 +409,19 @@ if (!isset($config['cf_cert_kg_mid'])) {
ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; ";
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);
$config['cf_cert_kcp_enckey'] = '';
}
if (!$config['cf_faq_skin']) {
$config['cf_faq_skin'] = "basic";
}
@@ -1003,6 +1016,16 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</select>
</td>
</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>
<th scope="row" class="cf_cert_service"><label for="cf_cert_hp">휴대폰 본인확인</label></th>
<td class="cf_cert_service">
@@ -1051,6 +1074,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>
</td>
</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>NHN_KCP 상점관리자 > 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키 발급 후에 인증키 정보를 입력') ?>
<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>
<th scope="row" class="cf_cert_service"><label for="cf_cert_limit">본인확인 이용제한</label></th>
<td class="cf_cert_service">
@@ -1527,7 +1557,17 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</table>
</div>
</section>
<div id="config_captcha_wrap" style="display:none">
<h2>캡챠입력</h2>
<?php
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
$captcha_html = captcha_html();
$captcha_js = chk_captcha_js();
echo $captcha_html;
?>
</div>
<div class="btn_fixed_top btn_confirm">
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
</div>
@@ -1599,10 +1639,61 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
});
});
// 각 요소의 초기값 저장
var initialValues = {
cf_admin: $('#cf_admin').val(),
cf_analytics: $('#cf_analytics').val(),
cf_add_meta: $('#cf_add_meta').val(),
cf_add_script: $('#cf_add_script').val()
};
function check_config_captcha_open() {
var isChanged = false;
// 현재 값이 있는 경우에만 변경 여부 체크
if ($('#cf_admin').val()) {
isChanged = isChanged || $('#cf_admin').val() !== initialValues.cf_admin;
}
if ($('#cf_analytics').val()) {
isChanged = isChanged || $('#cf_analytics').val() !== initialValues.cf_analytics;
}
if ($('#cf_add_meta').val()) {
isChanged = isChanged || $('#cf_add_meta').val() !== initialValues.cf_add_meta;
}
if ($('#cf_add_script').val()) {
isChanged = isChanged || $('#cf_add_script').val() !== initialValues.cf_add_script;
}
var $wrap = $("#config_captcha_wrap"),
tooptipid = "mp_captcha_tooltip",
$p_text = $("<p>", {id:tooptipid, style:"font-size:0.95em;letter-spacing:-0.1em"}).html("중요정보를 수정할 경우 캡챠를 입력해야 합니다."),
$children = $wrap.children(':first'),
is_invisible_recaptcha = $("#captcha").hasClass("invisible_recaptcha");
if(isChanged){
$wrap.show();
if(! is_invisible_recaptcha) {
$wrap.css("margin-top","1em");
if(! $("#"+tooptipid).length){ $children.after($p_text) }
}
} else {
$wrap.hide();
if($("#"+tooptipid).length && ! is_invisible_recaptcha){ $children.next("#"+tooptipid).remove(); }
}
return isChanged;
}
function fconfigform_submit(f) {
var current_user_ip = "<?php echo $_SERVER['REMOTE_ADDR']; ?>";
var cf_intercept_ip_val = f.cf_intercept_ip.value;
if (check_config_captcha_open()){
jQuery("html, body").scrollTop(jQuery("#config_captcha_wrap").offset().top);
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
}
if (cf_intercept_ip_val && current_user_ip) {
var cf_intercept_ips = cf_intercept_ip_val.split("\n");
@@ -1623,6 +1714,22 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
f.action = "./config_form_update.php";
return true;
}
jQuery(function($){
$("#captcha_key").prop('required', false).removeAttr("required").removeClass("required");
// 최고관리자 변경시
$(document).on('change', '#cf_admin', check_config_captcha_open);
// 방문자분석 스크립트 변경시
$(document).on('input', '#cf_analytics', check_config_captcha_open);
// 추가 메타태그 변경시
$(document).on('input', '#cf_add_meta', check_config_captcha_open);
// 추가 script, css 변경시
$(document).on('input', '#cf_add_script', check_config_captcha_open);
});
</script>
<?php
@@ -1654,16 +1761,19 @@ if ($config['cf_cert_use']) {
// kcp일 때
if ($config['cf_cert_hp'] == 'kcp') {
$bin_path = ((int)$config['cf_cert_use'] === 2 && !$config['cf_cert_kcp_enckey']) ? 'bin_old' : 'bin';
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if (PHP_INT_MAX == 2147483647) { // 32-bit
$exe = G5_KCPCERT_PATH . '/bin/ct_cli';
$exe = G5_KCPCERT_PATH . '/'.$bin_path.'/ct_cli';
} else {
$exe = G5_KCPCERT_PATH . '/bin/ct_cli_x64';
$exe = G5_KCPCERT_PATH . '/'.$bin_path.'/ct_cli_x64';
}
} else {
$exe = G5_KCPCERT_PATH . '/bin/ct_cli_exe.exe';
$exe = G5_KCPCERT_PATH . '/'.$bin_path.'/ct_cli_exe.exe';
}
echo module_exec_check($exe, 'ct_cli');
}
+46 -10
View File
@@ -10,9 +10,11 @@ if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.');
}
$sql = " select * from {$g5['config_table']} limit 1";
$ori_config = sql_fetch($sql);
$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) : '';
$posts = array();
$mb = get_member($cf_admin);
@@ -24,15 +26,15 @@ check_admin_token();
$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) {
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']) {
$pattern = explode("\n", trim($_POST['cf_intercept_ip']));
@@ -105,6 +107,7 @@ $check_keys = array(
'cf_cert_ipin' => 'char',
'cf_cert_hp' => 'char',
'cf_cert_simple' => 'char',
'cf_cert_use_seed' => 'int',
'cf_admin_email' => 'char',
'cf_admin_email_name' => 'char',
'cf_add_script' => 'text',
@@ -164,12 +167,12 @@ for ($i = 1; $i <= 10; $i++) {
foreach ($check_keys as $k => $v) {
if ($v === 'int') {
$posts[$key] = $_POST[$k] = isset($_POST[$k]) ? (int) $_POST[$k] : 0;
$_POST[$k] = isset($_POST[$k]) ? (int) $_POST[$k] : 0;
} else {
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 {
$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 +183,36 @@ if ($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] &&
}
if (!$_POST['cf_cert_use']) {
$posts[$key] = $_POST['cf_cert_ipin'] = '';
$posts[$key] = $_POST['cf_cert_hp'] = '';
$posts[$key] = $_POST['cf_cert_simple'] = '';
$_POST['cf_cert_ipin'] = '';
$_POST['cf_cert_hp'] = '';
$_POST['cf_cert_simple'] = '';
}
// 관리자가 자동등록방지를 사용해야 할 경우 ( 기본환경설정에서 최고관리자, 방문자분석 스크립트, 추가 메타태그, 추가 script, css 변경시 )
$check_captcha = 0;
if ($cf_admin && $ori_config['cf_admin'] !== $cf_admin) {
$check_captcha = 1;
}
if ($_POST['cf_analytics'] && $ori_config['cf_analytics'] !== stripslashes($_POST['cf_analytics'])) {
$check_captcha = 1;
}
if ($_POST['cf_add_meta'] && $ori_config['cf_add_meta'] !== stripslashes($_POST['cf_add_meta'])) {
$check_captcha = 1;
}
if ($_POST['cf_add_script'] && $ori_config['cf_add_script'] !== stripslashes($_POST['cf_add_script'])) {
$check_captcha = 1;
}
if ($check_captcha) {
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.');
}
}
$sql = " update {$g5['config_table']}
@@ -284,10 +314,12 @@ $sql = " update {$g5['config_table']}
cf_cert_ipin = '{$_POST['cf_cert_ipin']}',
cf_cert_hp = '{$_POST['cf_cert_hp']}',
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_mid = '" . trim($_POST['cf_cert_kg_mid']) . "',
cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_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_req = '{$_POST['cf_cert_req']}',
cf_sms_use = '{$_POST['cf_sms_use']}',
@@ -344,6 +376,10 @@ if (isset($_POST['cf_bbs_rewrite'])) {
g5_delete_all_cache();
}
if (function_exists('get_admin_captcha_by')) {
get_admin_captcha_by('remove');
}
run_event('admin_config_form_update');
update_rewrite_rules();
+2 -2
View File
@@ -205,7 +205,7 @@ if (isset($mb_id) && $mb_id) {
if ($mb['mb_intercept_date']) {
$g5['title'] = "차단된 ";
} else {
$g5['title'] .= "";
$g5['title'] = "";
}
$g5['title'] .= '회원 ' . $html_title;
require_once './admin.head.php';
@@ -455,7 +455,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<?php if ($config['cf_use_recommend']) { // 추천인 사용 ?>
<tr>
<th scope="row">추천인</th>
<td colspan="3"><?php echo ($mb['mb_recommend'] ? get_text($mb['mb_recommend']) : '없음'); // 081022 : CSRF 보안 결함으로 인한 코드 수정 ?></td>
<td colspan="3"><?php echo ((isset($mb['mb_recommend']) && $mb['mb_recommend']) ? get_text($mb['mb_recommend']) : '없음'); // 081022 : CSRF 보안 결함으로 인한 코드 수정 ?></td>
</tr>
<?php } ?>
+1 -1
View File
@@ -19,7 +19,7 @@ $mb_certify = isset($_POST['mb_certify']) ? preg_replace('/[^0-9a-z_]/i', ''
$mb_zip = isset($_POST['mb_zip']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_zip']) : '';
// 관리자가 자동등록방지를 사용해야 할 경우 ( 회원의 비밀번호 변경시 캡챠를 체크한다 )
if ($mb_password && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
if ($mb_password) {
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
if (!chk_captcha()) {
+13 -1
View File
@@ -117,6 +117,15 @@ if ($new == 'new' || !$code) {
});
});
function htmlEscape(str) {
return str
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}
function add_menu_list(name, link, code) {
var $menulist = $("#menulist", opener.document);
var ms = new Date().getTime();
@@ -126,7 +135,10 @@ if ($new == 'new' || !$code) {
<?php } else { ?>
sub_menu_class = " class=\"td_category sub_menu_class\"";
<?php } ?>
name = htmlEscape(name);
link = htmlEscape(link);
var list = "<tr class=\"menu_list menu_group_<?php echo $code; ?>\">";
list += "<td" + sub_menu_class + ">";
list += "<label for=\"me_name_" + ms + "\" class=\"sound_only\">메뉴<strong class=\"sound_only\"> 필수</strong></label>";
+2
View File
@@ -133,6 +133,8 @@ function pg_setting_check($is_print=false){
$pg_msg = 'LG유플러스';
} else if ( $default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] && $default['de_inicis_sign_key'] ){
$pg_msg = 'KG이니시스';
} else if ( $default['de_pg_service'] === 'nicepay' && $default['de_nicepay_mid'] && $default['de_nicepay_key'] ){
$pg_msg = 'NICEPAY';
}
}
+4 -4
View File
@@ -949,7 +949,7 @@ if(!$default['de_kakaopay_cancelpwd']){
</tr>
<tr class="pg_info_fld nicepay_info_fld" id="nicepay_info_anchor">
<th scope="row"><label for="de_nicepay_mid">NICEPAY MID</label><br><a href="http://sir.kr/main/service/inicis_pg.php" target="_blank" id="scf_nicepay_reg" class="nicepay_btn">NICEPAY 신청하기</a></th>
<th scope="row"><label for="de_nicepay_mid">NICEPAY MID</label><br><a href="http://sir.kr/main/service/nicepayments_pg.php" target="_blank" id="scf_nicepay_reg" class="nicepay_btn">NICEPAY 신청하기</a></th>
<td>
<span class="frm_info">NICEPAY로 부터 발급 받으신 상점MID를 SR 을 제외한 나머지 자리를 입력 합니다.<br>NICEPAY 상점관리자 > 가맹점정보 > KEY관리에서 확인 할수 있습니다.<br>만약, 상점아이디가 SR로 시작하지 않는다면 계약담당자에게 변경 요청을 해주시기 바랍니다. 예) SRpaytestm</span>
<span class="sitecode">SR</span>
@@ -1067,8 +1067,8 @@ if(!$default['de_kakaopay_cancelpwd']){
<a href="http://testadmin8.kcp.co.kr/" target="_blank" class="btn_frmline">테스트 관리자</a>
</div>
<div class="scf_cardtest lg_cardtest">
<a href="https://pgweb.uplus.co.kr/" target="_blank" class="btn_frmline">실결제 관리자</a>
<a href="https://pgweb.uplus.co.kr/tmert" target="_blank" class="btn_frmline">테스트 관리자</a>
<a href="https://app.tosspayments.com/" target="_blank" class="btn_frmline">실결제 관리자</a>
<a href="https://pgweb.tosspayments.com/tmert" target="_blank" class="btn_frmline">테스트 관리자</a>
</div>
<div class="scf_cardtest inicis_cardtest">
<a href="https://iniweb.inicis.com/" target="_blank" class="btn_frmline">상점 관리자</a>
@@ -1093,7 +1093,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<li><b>일반결제</b>의 테스트 사이트코드는 <b>T0000</b> 이며, <b>에스크로 결제</b>의 테스트 사이트코드는 <b>T0007</b> 입니다.</li>
</ul>
<ul id="lg_cardtest_tip" class="scf_cardtest_tip_adm scf_cardtest_tip_adm_hide">
<li>테스트결제의 <a href="http://pgweb.dacom.net:7085/" target="_blank">상점관리자</a> 로그인 정보는 토스페이먼츠 상점아이디 첫 글자에 t를 추가해서 로그인하시기 바랍니다. 예) tsi_lguplus</li>
<li>테스트결제의 <a href="https://pgweb.tosspayments.com/tmert" target="_blank">상점관리자</a> 로그인 정보는 토스페이먼츠 상점아이디 첫 글자에 t를 추가해서 로그인하시기 바랍니다. 예) tsi_lguplus</li>
</ul>
<ul id="inicis_cardtest_tip" class="scf_cardtest_tip_adm scf_cardtest_tip_adm_hide">
<li><b>일반결제</b>의 테스트 사이트 mid는 <b>INIpayTest</b> 이며, <b>에스크로 결제</b>의 테스트 사이트 mid는 <b>iniescrow0</b> 입니다.</li>
+7 -7
View File
@@ -46,13 +46,13 @@ include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
?>
<form name="fcouponform" action="./couponformupdate.php" method="post" onsubmit="return form_check(this);">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="cp_id" value="<?php echo $cp_id; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page;?>">
<input type="hidden" name="w" value="<?php echo get_sanitize_input($w); ?>">
<input type="hidden" name="cp_id" value="<?php echo get_sanitize_input($cp_id); ?>">
<input type="hidden" name="sst" value="<?php echo get_sanitize_input($sst); ?>">
<input type="hidden" name="sod" value="<?php echo get_sanitize_input($sod); ?>">
<input type="hidden" name="sfl" value="<?php echo get_sanitize_input($sfl); ?>">
<input type="hidden" name="stx" value="<?php echo get_sanitize_input($stx); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page);?>">
<div class="tbl_frm01 tbl_wrap">
<table>
+4 -4
View File
@@ -68,10 +68,10 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
</div>
<form name="flist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="sort1" value="<?php echo get_sanitize_input($sort1); ?>">
<input type="hidden" name="sort2" value="<?php echo get_sanitize_input($sort2); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<label for="sel_ca_id" class="sound_only">검색대상</label>
<select name="sel_ca_id" id="sel_ca_id">
+6 -7
View File
@@ -35,7 +35,7 @@ $sql_common .= $sql_search;
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$total_count = isset($row['cnt']) ? $row['cnt'] : 0;
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
@@ -67,10 +67,10 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
</div>
<form name="flist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="sort1" value="<?php echo get_sanitize_input($sort1); ?>">
<input type="hidden" name="sort2" value="<?php echo get_sanitize_input($sort2); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<label for="sel_ca_id" class="sound_only">분류선택</label>
<select name="sel_ca_id" id="sel_ca_id">
@@ -159,7 +159,6 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$it_stock_qty_st = ''; // 스타일 정의
if($row['it_stock_qty'] <= $row['it_noti_qty']) {
$it_stock_qty_st = ' sit_stock_qty_alert';
$it_stock_qty = ''.$it_stock_qty.' !<span class="sound_only"> 재고부족 </span>';
}
$bg = 'bg'.($i%2);
@@ -171,7 +170,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
<?php echo $row['it_id']; ?>
</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)$temporary_qty); ?></td>
<td class="td_num">
+4 -4
View File
@@ -74,10 +74,10 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
</div>
<form name="flist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="sort1" value="<?php echo get_sanitize_input($sort1); ?>">
<input type="hidden" name="sort2" value="<?php echo get_sanitize_input($sort2); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
+2 -2
View File
@@ -85,8 +85,8 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
</div>
<form name="flist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<label for="sca" class="sound_only">분류선택</label>
<select name="sca" id="sca">
+4 -4
View File
@@ -69,10 +69,10 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
</div>
<form name="flist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="sort1" value="<?php echo get_sanitize_input($sort1); ?>">
<input type="hidden" name="sort2" value="<?php echo get_sanitize_input($sort2); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<label for="sel_ca_id" class="sound_only">분류선택</label>
<select name="sel_ca_id" id="sel_ca_id">
+2 -2
View File
@@ -510,10 +510,10 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
if ($od['od_settle_case'] != '무통장') {
switch($od['od_pg']) {
case 'lg':
$pg_url = 'http://pgweb.uplus.co.kr';
$pg_url = 'https://app.tosspayments.com';
$pg_test = '토스페이먼츠';
if ($default['de_card_test']) {
$pg_url = 'http://pgweb.uplus.co.kr/tmert';
$pg_url = 'https://pgweb.tosspayments.com/tmert';
$pg_test .= ' 테스트 ';
}
break;
+6 -5
View File
@@ -16,6 +16,7 @@ $sort2 = (isset($_GET['sort2']) && in_array($_GET['sort2'], array('desc', 'asc')
$sel_field = (isset($_GET['sel_field']) && in_array($_GET['sel_field'], array('od_id', 'mb_id', 'od_name', 'od_tel', 'od_hp', 'od_b_name', 'od_b_tel', 'od_b_hp', 'od_deposit_name', 'od_invoice')) ) ? $_GET['sel_field'] : '';
$od_status = isset($_GET['od_status']) ? get_search_string($_GET['od_status']) : '';
$search = isset($_GET['search']) ? get_search_string($_GET['search']) : '';
$save_search = isset($_GET['save_search']) ? get_search_string($_GET['save_search']) : '';
$fr_date = (isset($_GET['fr_date']) && preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $_GET['fr_date'])) ? $_GET['fr_date'] : '';
$to_date = (isset($_GET['to_date']) && preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $_GET['to_date'])) ? $_GET['to_date'] : '';
@@ -160,11 +161,11 @@ if( function_exists('pg_setting_check') ){
</div>
<form name="frmorderlist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="sort1" value="<?php echo get_sanitize_input($sort1); ?>">
<input type="hidden" name="sort2" value="<?php echo get_sanitize_input($sort2); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<input type="hidden" name="save_search" value="<?php echo get_sanitize_input($search); ?>">
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
+3 -3
View File
@@ -49,7 +49,7 @@ if ($csv == 'csv')
$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
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
@@ -65,7 +65,7 @@ if ($csv == 'csv')
alert("출력할 내역이 없습니다.");
//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('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename="orderlist-' . date("ymd", time()) . '.csv"');
@@ -153,7 +153,7 @@ if ($csv == 'xls')
$fr_date = date_conv($fr_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
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
+6
View File
@@ -44,6 +44,12 @@ if($popup == 'yes') { // 팝업창일 때
$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_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 { // 현재페이지일 때
include_once (G5_ADMIN_PATH.'/admin.head.php');
+2 -2
View File
@@ -58,8 +58,8 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
</div>
<form name="flist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<label for="sel_ca_id" class="sound_only">검색대상</label>
<select name="sel_ca_id" id="sel_ca_id">
+2 -2
View File
@@ -4,8 +4,8 @@ include_once('./_common.php');
if (!$is_member) die('0');
$uid = isset($_REQUEST['uid']) ? preg_replace('/[^0-9]/', '', $_REQUEST['uid']) : 0;
$subject = isset($_REQUEST['subject']) ? trim($_REQUEST['subject']) : '';
$content = isset($_REQUEST['content']) ? trim($_REQUEST['content']) : '';
$subject = isset($_REQUEST['subject']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['subject']),0,255)) : '';
$content = isset($_REQUEST['content']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['content']),0,65536)) : '';
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' ";
+5 -1
View File
@@ -29,7 +29,11 @@ if($config['cf_popular_del'] > 0) {
if($config['cf_new_del'] > 0) {
$sql = " delete from {$g5['board_new_table']} where (TO_DAYS('".G5_TIME_YMDHIS."') - TO_DAYS(bn_datetime)) > '{$config['cf_new_del']}' ";
sql_query($sql);
sql_query(" OPTIMIZE TABLE `{$g5['board_new_table']}` ");
// 데이터가 많으면 처리시간 때문에 브라우저 응답이 늦을수 있음
if (defined('G5_USE_OPTIMIZE_DBTABLE') && G5_USE_OPTIMIZE_DBTABLE) {
sql_query(" OPTIMIZE TABLE `{$g5['board_new_table']}` ");
}
}
// 설정일이 지난 쪽지 삭제
+1
View File
@@ -3,6 +3,7 @@
include_once('./_common.php');
$comment_id = isset($_REQUEST['comment_id']) ? (int) $_REQUEST['comment_id'] : 0;
$token = isset($_REQUEST['token']) ? clean_xss_tags($_REQUEST['token']) : 0;
$delete_comment_token = get_session('ss_delete_comment_'.$comment_id.'_token');
set_session('ss_delete_comment_'.$comment_id.'_token', '');
+2
View File
@@ -1,6 +1,8 @@
<?php
include_once('./_common.php');
$good = isset($_REQUEST['good']) ? preg_replace('/[^a-z0-9]/i', '', $_REQUEST['good']) : '';
run_event('bbs_good_before', $bo_table, $wr_id, $good);
@include_once($board_skin_path.'/good.head.skin.php');
+7 -3
View File
@@ -1,7 +1,11 @@
<?php
include_once('./_common.php');
$html_title = '링크 &gt; '.conv_subject($write['wr_subject'], 255);
$html_title = '링크';
if (isset($write['wr_subject']) && $write['wr_subject']) {
$html_title .= ' &gt; '.conv_subject($write['wr_subject'], 255);
}
$no = isset($_REQUEST['no']) ? preg_replace('/[^0-9]/i', '', $_REQUEST['no']) : '';
@@ -10,10 +14,10 @@ if (!($bo_table && $wr_id && $no))
// SQL Injection 예방
$row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} ", FALSE);
if (!$row['cnt'])
if (!(isset($row['cnt']) && $row['cnt']))
alert_close('존재하는 게시판이 아닙니다.');
if (!$write['wr_link'.$no])
if (!(isset($write['wr_link'.$no]) && $write['wr_link'.$no]))
alert_close('링크가 없습니다.');
$ss_name = 'ss_link_'.$bo_table.'_'.$wr_id.'_'.$no;
-1
View File
@@ -8,7 +8,6 @@ if( function_exists('social_check_login_before') ){
$g5['title'] = '로그인';
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') : '';
// url 체크
+9 -1
View File
@@ -147,8 +147,16 @@ if(function_exists('set_cart_id')){
cart_item_clean();
set_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);
}
+4 -2
View File
@@ -4,8 +4,6 @@ include_once('./_common.php');
if ($is_guest)
alert('로그인 한 회원만 접근하실 수 있습니다.', G5_BBS_URL.'/login.php');
$url = isset($_GET['url']) ? clean_xss_tags($_GET['url']) : '';
while (1) {
$tmp = preg_replace('/&#[^;]+;/', '', $url);
if ($tmp == $url) break;
@@ -31,6 +29,10 @@ if($url){
if( preg_match('#^/{3,}#', $url) ){
$url = preg_replace('#^/{3,}#', '/', $url);
}
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
}
$url = get_text($url);
+9 -5
View File
@@ -14,24 +14,28 @@ $str_nick_list = '';
$msg = '';
$error_list = 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);
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 ($is_admin || ($row['mb_open'] && (!$row['mb_leave_date'] && !$row['mb_intercept_date']))) {
$member_list['id'][] = $row['mb_id'];
$member_list['nick'][] = $row['mb_nick'];
} 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) {
$error_list[] = $recv_list[$i];
$error_list[] = $recv_list_id;
} else {
$member_list['id'][] = $row['mb_id'];
$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]);
// 받는 회원 쪽지 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);
if( $me_id = sql_insert_id() ){
// 보내는 회원 쪽지 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);
$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
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_is_comment = '{$row2['wr_is_comment']}',
wr_comment = '{$row2['wr_comment']}',
+2 -2
View File
@@ -23,7 +23,7 @@ switch ($w) {
break;
case 's' :
// 비밀번호 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
if ($is_admin || ($member['mb_id'] == $write['mb_id'] && $write['mb_id']))
if ($is_admin || (isset($write['mb_id']) && $write['mb_id'] && $member['mb_id'] == $write['mb_id']))
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
else {
$action = https_url(G5_BBS_DIR).'/password_check.php';
@@ -32,7 +32,7 @@ switch ($w) {
break;
case 'sc' :
// 비밀번호 창에서 로그인 하는 경우 관리자 또는 자신의 글이면 바로 글보기로 감
if ($is_admin || ($member['mb_id'] == $write['mb_id'] && $write['mb_id']))
if ($is_admin || (isset($write['mb_id']) && $write['mb_id'] && $member['mb_id'] == $write['mb_id']))
goto_url(short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id));
else {
$action = https_url(G5_BBS_DIR).'/password_check.php';
+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 = 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']))
alert('po_id 값이 제대로 넘어오지 않았습니다.');
+8 -8
View File
@@ -64,15 +64,15 @@ $mb_8 = isset($_POST['mb_8']) ? trim($_POST['mb_8'])
$mb_9 = isset($_POST['mb_9']) ? trim($_POST['mb_9']) : "";
$mb_10 = isset($_POST['mb_10']) ? trim($_POST['mb_10']) : "";
$mb_name = clean_xss_tags($mb_name);
$mb_name = clean_xss_tags($mb_name, 1, 1);
$mb_email = get_email_address($mb_email);
$mb_homepage = clean_xss_tags($mb_homepage);
$mb_tel = clean_xss_tags($mb_tel);
$mb_homepage = clean_xss_tags($mb_homepage, 1, 1);
$mb_tel = clean_xss_tags($mb_tel, 1, 1);
$mb_zip1 = preg_replace('/[^0-9]/', '', $mb_zip1);
$mb_zip2 = preg_replace('/[^0-9]/', '', $mb_zip2);
$mb_addr1 = clean_xss_tags($mb_addr1);
$mb_addr2 = clean_xss_tags($mb_addr2);
$mb_addr3 = clean_xss_tags($mb_addr3);
$mb_addr1 = clean_xss_tags($mb_addr1, 1, 1);
$mb_addr2 = clean_xss_tags($mb_addr2, 1, 1);
$mb_addr3 = clean_xss_tags($mb_addr3, 1, 1);
$mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
run_event('register_form_update_before', $mb_id, $w);
@@ -338,7 +338,7 @@ if ($w == '') {
$sql_nick_date = " , mb_nick_date = '".G5_TIME_YMD."' ";
$sql_open_date = "";
if ($mb_open_default != $mb_open)
if (isset($mb_open_default) && $mb_open_default != $mb_open)
$sql_open_date = " , mb_open_date = '".G5_TIME_YMD."' ";
// 이전 메일주소와 수정한 메일주소가 틀리다면 인증을 다시 해야하므로 값을 삭제
@@ -531,7 +531,7 @@ if ($config['cf_use_email_certify'] && $old_email != $mb_email) {
// 신규회원 쿠폰발생
if($w == '' && $default['de_member_reg_coupon_use'] && $default['de_member_reg_coupon_term'] > 0 && $default['de_member_reg_coupon_price'] > 0) {
if($w == '' && isset($default['de_member_reg_coupon_use']) && $default['de_member_reg_coupon_use'] && $default['de_member_reg_coupon_term'] > 0 && $default['de_member_reg_coupon_price'] > 0) {
$j = 0;
$create_coupon = false;
+1 -1
View File
@@ -5,7 +5,7 @@ if (isset($_SESSION['ss_mb_reg']))
$mb = get_member($_SESSION['ss_mb_reg']);
// 회원정보가 없다면 초기 페이지로 이동
if (!$mb['mb_id'])
if (!(isset($mb['mb_id']) && $mb['mb_id']))
goto_url(G5_URL);
$g5['title'] = '회원가입 완료';
+3 -3
View File
@@ -6,8 +6,8 @@ if (get_cookie('ck_visit_ip') != $_SERVER['REMOTE_ADDR'])
{
set_cookie('ck_visit_ip', $_SERVER['REMOTE_ADDR'], 86400); // 하루동안 저장
$tmp_row = sql_fetch(" select max(vi_id) as max_vi_id from {$g5['visit_table']} ");
$vi_id = $tmp_row['max_vi_id'] + 1;
// $tmp_row = sql_fetch(" select max(vi_id) as max_vi_id from {$g5['visit_table']} ");
// $vi_id = $tmp_row['max_vi_id'] + 1;
// $_SERVER 배열변수 값의 변조를 이용한 SQL Injection 공격을 막는 코드입니다. 110810
$remote_addr = escape_trim($_SERVER['REMOTE_ADDR']);
@@ -23,7 +23,7 @@ if (get_cookie('ck_visit_ip') != $_SERVER['REMOTE_ADDR'])
if(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE) {
include_once(G5_BBS_PATH.'/visit_browscap.inc.php');
}
$sql = " insert {$g5['visit_table']} ( vi_id, vi_ip, vi_date, vi_time, vi_referer, vi_agent, vi_browser, vi_os, vi_device ) values ( '{$vi_id}', '{$remote_addr}', '".G5_TIME_YMD."', '".G5_TIME_HIS."', '{$referer}', '{$user_agent}', '{$vi_browser}', '{$vi_os}', '{$vi_device}' ) ";
$sql = " insert {$g5['visit_table']} ( vi_ip, vi_date, vi_time, vi_referer, vi_agent, vi_browser, vi_os, vi_device ) values ( '{$remote_addr}', '".G5_TIME_YMD."', '".G5_TIME_HIS."', '{$referer}', '{$user_agent}', '{$vi_browser}', '{$vi_os}', '{$vi_device}' ) ";
$result = sql_query($sql, FALSE);
// 정상으로 INSERT 되었다면 방문자 합계에 반영
+1 -1
View File
@@ -20,7 +20,7 @@ if (!($w == '' || $w == 'u' || $w == 'r')) {
}
if ($w == 'u' || $w == 'r') {
if ($write['wr_id']) {
if (isset($write['wr_id']) && $write['wr_id']) {
// 가변 변수로 $wr_1 .. $wr_10 까지 만든다.
for ($i=1; $i<=10; $i++) {
$vvar = "wr_".$i;
+7 -1
View File
@@ -31,6 +31,9 @@ $wr_subject = '';
if (isset($_POST['wr_subject'])) {
$wr_subject = substr(trim($_POST['wr_subject']),0,255);
$wr_subject = preg_replace("#[\\\]+$#", "", $wr_subject);
if (function_exists('normalize_utf8_string')) {
$wr_subject = normalize_utf8_string($wr_subject);
}
}
if ($wr_subject == '') {
$msg[] = '<strong>제목</strong>을 입력하세요.';
@@ -40,6 +43,9 @@ $wr_content = '';
if (isset($_POST['wr_content'])) {
$wr_content = substr(trim($_POST['wr_content']),0,65536);
$wr_content = preg_replace("#[\\\]+$#", "", $wr_content);
if (function_exists('normalize_utf8_string')) {
$wr_content = normalize_utf8_string($wr_content);
}
}
if ($wr_content == '') {
$msg[] = '<strong>내용</strong>을 입력하세요.';
@@ -679,7 +685,7 @@ sql_query(" delete from {$g5['autosave_table']} where as_uid = '{$uid}' ");
// 비밀글이라면 세션에 비밀글의 아이디를 저장한다. 자신의 글은 다시 비밀번호를 묻지 않기 위함
if ($secret) {
if (! $wr_num) {
if (!(isset($wr_num) && $wr_num)) {
$write = get_write($write_table, $wr_id, true);
$wr_num = $write['wr_num'];
}
+110
View File
@@ -0,0 +1,110 @@
<?php
// CloudFlare를 사용시, 사용자 환경에 맞는 $_SERVER['REMOTE_ADDR']과 $_SERVER['HTTPS'] 사용 여부를 수정합니다.
class G5CloudflareRequestHandler {
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'] && G5CloudflareRequestHandler::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';
}
}
+45 -49
View File
@@ -29,6 +29,10 @@ for ($i=0; $i<$ext_cnt; $i++) {
}
//==========================================================================================================================
// Cloudflare 사용시 REMOTE_ADDR 에 사용자 IP 적용과 https 사용 여부
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
include_once('cloudflare.check.php'); // cloudflare 의 ip 대역인지 체크
}
function g5_path()
{
@@ -58,15 +62,10 @@ include_once($g5_path['path'].'/config.php'); // 설정 파일
unset($g5_path);
// IIS 에서 SERVER_ADDR 서버변수가 없다면
if(! isset($_SERVER['SERVER_ADDR'])) {
if (!isset($_SERVER['SERVER_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에 사용자지정 함수적용
function array_map_deep($fn, $array)
{
@@ -505,7 +504,7 @@ if (isset($_REQUEST['bo_table']) && ! is_array($_REQUEST['bo_table'])) {
// URL ENCODING
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);
} else {
$url = '';
@@ -526,7 +525,6 @@ if (isset($_REQUEST['gr_id'])) {
}
//===================================
// 자동로그인 부분에서 첫로그인에 포인트 부여하던것을 로그인중일때로 변경하면서 코드도 대폭 수정하였습니다.
if (isset($_SESSION['ss_mb_id']) && $_SESSION['ss_mb_id']) { // 로그인중이라면
$member = get_member($_SESSION['ss_mb_id']);
@@ -586,6 +584,45 @@ if (isset($_SESSION['ss_mb_id']) && $_SESSION['ss_mb_id']) { // 로그인중이
// 자동로그인 end ---------------------------------------
}
// 최고관리자가 아니면 IP를 체크한다.
if (!(isset($member['mb_id']) && $config['cf_admin'] === $member['mb_id'])) {
// 접근가능 IP
$cf_possible_ip = trim($config['cf_possible_ip']);
if ($cf_possible_ip) {
$is_possible_ip = false;
$pattern = explode("\n", $cf_possible_ip);
for ($i=0; $i<count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i]))
continue;
$pattern[$i] = str_replace(".", "\.", $pattern[$i]);
$pattern[$i] = str_replace("+", "[0-9\.]+", $pattern[$i]);
$pat = "/^{$pattern[$i]}$/";
$is_possible_ip = preg_match($pat, $_SERVER['REMOTE_ADDR']);
if ($is_possible_ip)
break;
}
if (!$is_possible_ip)
die ("<meta charset=utf-8>접근이 가능하지 않습니다.");
}
// 접근차단 IP
$is_intercept_ip = false;
$pattern = explode("\n", trim($config['cf_intercept_ip']));
for ($i=0; $i<count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i]))
continue;
$pattern[$i] = str_replace(".", "\.", $pattern[$i]);
$pattern[$i] = str_replace("+", "[0-9\.]+", $pattern[$i]);
$pat = "/^{$pattern[$i]}$/";
$is_intercept_ip = preg_match($pat, $_SERVER['REMOTE_ADDR']);
if ($is_intercept_ip)
die ("<meta charset=utf-8>접근 불가합니다.");
}
}
/** @var array $write 글 데이터 */
$write = array();
@@ -638,47 +675,6 @@ if (isset($member['mb_id']) && $member['mb_id']) {
$member['mb_level'] = 1; // 비회원의 경우 회원레벨을 가장 낮게 설정
}
if ($is_admin != 'super') {
// 접근가능 IP
$cf_possible_ip = trim($config['cf_possible_ip']);
if ($cf_possible_ip) {
$is_possible_ip = false;
$pattern = explode("\n", $cf_possible_ip);
for ($i=0; $i<count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i]))
continue;
$pattern[$i] = str_replace(".", "\.", $pattern[$i]);
$pattern[$i] = str_replace("+", "[0-9\.]+", $pattern[$i]);
$pat = "/^{$pattern[$i]}$/";
$is_possible_ip = preg_match($pat, $_SERVER['REMOTE_ADDR']);
if ($is_possible_ip)
break;
}
if (!$is_possible_ip)
die ("<meta charset=utf-8>접근이 가능하지 않습니다.");
}
// 접근차단 IP
$is_intercept_ip = false;
$pattern = explode("\n", trim($config['cf_intercept_ip']));
for ($i=0; $i<count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i]))
continue;
$pattern[$i] = str_replace(".", "\.", $pattern[$i]);
$pattern[$i] = str_replace("+", "[0-9\.]+", $pattern[$i]);
$pat = "/^{$pattern[$i]}$/";
$is_intercept_ip = preg_match($pat, $_SERVER['REMOTE_ADDR']);
if ($is_intercept_ip)
die ("<meta charset=utf-8>접근 불가합니다.");
}
}
// 테마경로
if(defined('_THEME_PREVIEW_') && _THEME_PREVIEW_ === true)
$config['cf_theme'] = isset($_GET['theme']) ? trim($_GET['theme']) : '';
+2
View File
@@ -1,6 +1,8 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
define('KGINICIS_USE_CERT_SEED', isset($config['cf_cert_use_seed']) ? (int) $config['cf_cert_use_seed'] : 1);
// 유저 사이드뷰에서 아이콘 지정 안했을시 기본 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>');
+12 -9
View File
@@ -8,21 +8,24 @@ if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) return;
.'(배송업체명^택배조회URL^연락처)'
*/
define('G5_DELIVERY_COMPANY',
'(경동택배^https://kdexp.com/basicNewDelivery.kd?barcode=^080-873-2178)'
'(경동택배^https://kdexp.com/service/delivery/etc/delivery.do?barcode=^1899-5368)'
.'(대신택배^https://www.ds3211.co.kr/freight/internalFreightSearch.ht?billno=^043-222-4582)'
.'(동부택배^http://www.dongbups.com/delivery/delivery_search_view.jsp?item_no=^1588-8848)'
.'(로젠택배^https://www.ilogen.com/m/personal/trace.pop/^1588-9988)'
.'(우체국^https://m.epost.go.kr/postal/mobile/mobile.trace.RetrieveDomRigiTraceList.comm?ems_gubun=E&sid1=^1588-1300)'
.'(이노지스택배^http://www.innogis.co.kr/tracking_view.asp?invoice=^1566-4082)'
.'(한진택배^https://www.hanjin.co.kr/kor/CMS/DeliveryMgr/WaybillResult.do?mCode=MN038&schLang=KR&wblnumText2=^1588-0011)'
.'(롯데택배^https://www.lotteglogis.com/open/tracking?invno=^1588-2121)'
.'(CJ대한통운^https://www.doortodoor.co.kr/parcel/doortodoor.do?fsp_action=PARC_ACT_002&fsp_cmd=retrieveInvNoACT&invc_no=^1588-1255)'
.'(CVSnet편의점택배^https://www.cvsnet.co.kr/invoice/tracking.do?invoice_no=^1577-1287)'
.'(KG옐로우캡택배^http://www.yellowcap.co.kr/custom/inquiry_result.asp?invoice_no=^1588-0123)'
.'(KGB택배^http://www.kgbls.co.kr/sub5/trace.asp?f_slipno=^1577-4577)'
.'(KG로지스^http://www.kglogis.co.kr/contents/waybill.jsp?item_no=^1588-8848)'
.'(CJ대한통운^https://trace.cjlogistics.com/next/tracking.html?wblNo=^1588-1255)'
.'(GS25편의점택배^https://www.cvsnet.co.kr/invoice/tracking.do?invoice_no=^1577-1287)'
.'(합동택배^https://hdexp.co.kr/deliverySearch2.hd?barcode=^1899-3392)'
.'(CU편의점택배^https://www.cupost.co.kr/postbox/delivery/localResult.cupost?invoice_no=^1577-1287)'
.'(천일택배^http://www.chunil.co.kr/HTrace/HTrace.jsp?transNo=^1877-6606)'
.'(건영택배^https://www.kunyoung.com/goods/goods_01.php?mulno=^031-460-2700)'
.'(호남택배^http://www.honamlogis.co.kr/04estimate/songjang_list.php?c_search1=^031-376-6070)'
.'(우리택배^http://www.honamlogis.co.kr/04estimate/songjang_list.php?c_search1=^031-376-6070)'
.'(일양로지스^https://www.ilyanglogis.com/functionality/popup_result.asp?hawb_no=^1588-0002)'
.'(EMS^https://service.epost.go.kr/trace.RetrieveEmsRigiTraceList.comm?POST_CODE=^1588-1300)'
.'(DHL^https://www.dhl.com/kr-ko/home/tracking.html?tracking-id=^1588-1588-0001)'
.'(FedEx^https://www.fedex.com/fedextrack/?trknbr=^02-3496-7777)'
.'(UPS^https://www.fedex.com/fedextrack/?trknbr=^02-3496-7777)'
);
include_once(G5_LIB_PATH.'/shop.data.lib.php');
+1
View File
@@ -1,5 +1,6 @@
<?php
$g5_path['path'] = '..';
include_once('install_common.php');
include_once('../config.php');
include_once('./install.function.php'); // 인스톨 과정 함수 모음
include_once('../lib/common.lib.php'); // 공통 라이브러리
+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_kg_cd` 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_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_mert_key` varchar(100) NOT NULL DEFAULT '',
`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 '',
`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',
UNIQUE KEY `mp_no` (`mp_no`),
PRIMARY KEY (`mp_no`),
KEY `mb_id` (`mb_id`),
KEY `provider` (`provider`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+1
View File
@@ -2,6 +2,7 @@
@header('Content-Type: text/html; charset=utf-8');
@header('X-Robots-Tag: noindex');
$g5_path['path'] = '..';
include_once('install_common.php');
include_once ('../config.php');
$title = G5_VERSION." 라이센스 확인 1/3";
include_once ('./install.inc.php');
+4
View File
@@ -0,0 +1,4 @@
<?php
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
include_once('../cloudflare.check.php'); // cloudflare 의 ip 대역인지 체크
}
+1
View File
@@ -9,6 +9,7 @@ header('Pragma: no-cache'); // HTTP/1.0
@header('X-Robots-Tag: noindex');
$g5_path['path'] = '..';
include_once('install_common.php');
include_once ('../config.php');
$title = G5_VERSION." 초기환경설정 2/3";
include_once ('./install.inc.php');
+1
View File
@@ -10,6 +10,7 @@ header('Pragma: no-cache'); // HTTP/1.0
@header('X-Robots-Tag: noindex');
$g5_path['path'] = '..';
include_once('install_common.php');
include_once('../config.php');
include_once('../lib/common.lib.php');
include_once('./install.function.php'); // 인스톨 과정 함수 모음
+1 -1
View File
@@ -134,7 +134,7 @@ function no_comma(data)
function del(href)
{
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
document.location.href = href;
window.location.href = href;
}
}
+6
View File
@@ -24,6 +24,9 @@
var width = $this.width();
$img.each(function() {
if ($(this).attr("loading") === "lazy") return; // loading="lazy" 속성이 있는 경우 건너뜀
if($(this).data("width") == undefined)
$(this).data("width", $(this).width());
@@ -73,6 +76,9 @@
var width = $this.width();
$img.each(function() {
if ($(this).attr("loading") === "lazy") return; // loading="lazy" 속성이 있는 경우 건너뜀
$(this).removeAttr("width")
.removeAttr("height")
.css("width","")
+97 -34
View File
@@ -102,6 +102,10 @@ function 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);
//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);
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
$msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.';
$header = '';
@@ -220,6 +228,12 @@ function confirm($msg, $url1='', $url2='', $url3='')
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)) {
$msg = '$url1 과 $url2 를 지정해 주세요.';
alert($msg);
@@ -671,6 +685,10 @@ function html_purifier($html)
)
);
// 커스텀 URI 필터 등록
$def = $config->getDefinition('URI', true); // URI 정의 가져오기
$def->addFilter(new HTMLPurifierContinueParamFilter(), $config); // 커스텀 필터 추가
$purifier = new HTMLPurifier($config);
return run_replace('html_purifier_result', $purifier->purify($html), $purifier, $html);
@@ -712,7 +730,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
$tmp = explode(",", trim($search_field));
$field = explode("||", $tmp[0]);
$not_comment = "";
if (!empty($tmp[1]))
if (isset($tmp[1]))
$not_comment = $tmp[1];
$str .= "(";
@@ -768,8 +786,11 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
$op1 = " $search_operator ";
}
$str .= " ) ";
if ($not_comment)
if ($not_comment === '1') {
$str .= " and wr_is_comment = '0' ";
} else if ($not_comment === '0') {
$str .= " and wr_is_comment = '1' ";
}
return $str;
}
@@ -832,23 +853,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;
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();
}
static $cache = array();
$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];
}
$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);
@@ -1320,6 +1351,10 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
and po_rel_action = '$rel_action' ";
$row = sql_fetch($sql);
if (! (isset($row['po_id']) && $row['po_id'])) {
return true;
}
if(isset($row['po_point']) && $row['po_point'] < 0) {
$mb_id = $row['mb_id'];
$po_point = abs($row['po_point']);
@@ -1367,15 +1402,14 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
static $cache = array();
$name = get_text($name, 0, true);
if (isset($cache['id:' . $mb_id]) && $cache['id:' . $mb_id]) {
$namekey = ($mb_id && $name) ? $mb_id."\t".$name : '';
// id는 유니크하지만 닉네임 또는 이름은 변경이 가능하다
// name의 경우 비회원은 게시판에 동일한 이름을 등록할수 있다.
if ($namekey && isset($cache['idname:' . $namekey]) && $cache['idname:' . $namekey]) {
return $cache['idname:' . $namekey];
} else if (isset($cache['id:' . $mb_id]) && $cache['id:' . $mb_id]) {
return $cache['id:' . $mb_id];
} else if (
isset($name)
&& isset($cache['name:' . $name])
&& $cache['name:' . $name]
) {
return $cache['name:' . $name];
}
$email = get_string_encrypt($email);
@@ -1489,11 +1523,11 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
$str .= $str2;
$str .= '<noscript class="sv_nojs">' . $str2 . '</noscript>';
$str .= "</span>";
if ($mb_id) {
if ($namekey) {
$cache['idname:' . $namekey] = $str;
} else if ($mb_id && !$name) {
$cache['id:' . $mb_id] = $str;
} else {
$cache['name:' . $name] = $str;
}
return $str;
@@ -1652,7 +1686,10 @@ function sql_connect($host, $user, $pass, $db=G5_MYSQL_DB)
die('Connect Error: '.mysqli_connect_error());
}
} 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;
@@ -2098,7 +2135,7 @@ function time_select($time, $name="")
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++) {
$s .= "<option value='$i'";
if ($i == $m['0']) {
@@ -2246,6 +2283,24 @@ function _callback_bad_tag_convert($matches){
return "<div class=\"embedx\">보안문제로 인하여 관리자 아이디로는 embed 또는 object 태그를 볼 수 없습니다. 확인하시려면 관리권한이 없는 다른 아이디로 접속하세요.</div>";
}
function normalize_utf8_string($string) {
// utf8mb4 환경과 mb_ord 함수가 지원되지 않는 환경에서는 제외한다.
if (G5_DB_CHARSET === 'utf8mb4' || !function_exists('mb_ord')) {
return $string;
}
// Unicode 특수 문자를 일반 문자로 변환
$normalized = preg_replace_callback('/[\x{1D400}-\x{1D7FF}]/u', '_callback_normalizeString', $string);
return $normalized;
}
function _callback_normalizeString($matches){
$charCode = mb_ord($matches[0], 'UTF-8');
// 변환 테이블에서 일반 문자로 매핑
return chr(($charCode - 0x1D400) % 26 + ord('A'));
}
// 토큰 생성
function _token()
{
@@ -3594,6 +3649,13 @@ function login_password_check($mb, $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 인지
function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
{
@@ -4053,15 +4115,9 @@ function safe_replace_regex($str, $str_case=''){
return preg_replace('/[^0-9a-z_\-]/i', '', $str);
}
function get_real_client_ip(){
$real_ip = $_SERVER['REMOTE_ADDR'];
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/', $_SERVER['HTTP_X_FORWARDED_FOR']) ){
$real_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return preg_replace('/[^0-9.]/', '', $real_ip);
function get_real_client_ip() {
return run_replace('get_real_client_ip', $_SERVER['REMOTE_ADDR']);
}
function check_mail_bot($ip=''){
@@ -4130,7 +4186,14 @@ function is_include_path_check($path='', $is_input='')
if ( $peer_count && $peer_count > $slash_count ){
return false;
}
$dirname_doc_root = !empty($_SERVER['DOCUMENT_ROOT']) ? dirname($_SERVER['DOCUMENT_ROOT']) : dirname(dirname(dirname(__DIR__)));
// 웹서버 폴더만 허용
if ($dirname_doc_root && file_exists($path) && strpos(realpath($path), realpath($dirname_doc_root)) !== 0) {
return false;
}
try {
// whether $path is unix or not
$unipath = strlen($path)==0 || substr($path, 0, 1) != '/';
@@ -4166,8 +4229,8 @@ function is_include_path_check($path='', $is_input='')
//echo 'Caught exception: ', $e->getMessage(), "\n";
return false;
}
if( preg_match('/\/data\/(file|editor|qa|cache|member|member_image|session|tmp)\/[A-Za-z0-9_]{1,20}\//i', $replace_path) ){
if (preg_match('/\/data\/(file|editor|qa|cache|member|member_image|session|tmp)\/[A-Za-z0-9_]{1,20}\//i', $replace_path) || preg_match('/pear(cmd)?\.php/i', $replace_path)){
return false;
}
if( preg_match('/'.G5_PLUGIN_DIR.'\//i', $replace_path) && (preg_match('/'.G5_OKNAME_DIR.'\//i', $replace_path) || preg_match('/'.G5_KCPCERT_DIR.'\//i', $replace_path) || preg_match('/'.G5_LGXPAY_DIR.'\//i', $replace_path)) || (preg_match('/search\.skin\.php/i', $replace_path) ) ){
+2
View File
@@ -145,6 +145,8 @@ function get_content_by_field($write_table, $type='bbs', $where_field='', $where
{
global $g5, $g5_object;
static $cache = array();
$order_key = 'wr_id';
if( $type === 'content' ){
+1 -1
View File
@@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
// $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;
+5 -2
View File
@@ -52,9 +52,12 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
$mail = run_replace('mail_options', $mail, $fname, $fmail, $to, $subject, $content, $type, $file, $cc, $bcc);
$mail_send_result = $mail->send();
if (!($mail_send_result = $mail->send())) {
throw new Exception($mail->ErrorInfo);
}
} catch (Exception $e) {
error_log("Mail sending error: " . $e->getMessage());
}
run_event('mail_send_result', $mail_send_result, $mail, $to, $cc, $bcc);
+3 -3
View File
@@ -2641,10 +2641,10 @@ function make_order_field($data, $exclude)
if(is_array($value)) {
foreach($value as $k=>$v) {
$field .= '<input type="hidden" name="'.$key.'['.$k.']" value="'.get_text($v).'">'.PHP_EOL;
$field .= '<input type="hidden" name="'.get_text($key.'['.$k.']').'" value="'.get_text($v).'">'.PHP_EOL;
}
} else {
$field .= '<input type="hidden" name="'.$key.'" value="'.get_text($value).'">'.PHP_EOL;
$field .= '<input type="hidden" name="'.get_text($key).'" value="'.get_text($value).'">'.PHP_EOL;
}
}
@@ -2747,7 +2747,7 @@ function is_inicis_order_pay($type){
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();
$images = array();
+3 -3
View File
@@ -130,13 +130,13 @@
</wsdl:binding>
<wsdl:service name="PayService">
<wsdl:port name="PayServiceHttpSoap11Endpoint" binding="ns:PayServiceSoap11Binding">
<soap:address location="https://devpggw.kcp.co.kr:8100/services/KCPPaymentService"/>
<soap:address location="https://testsmpay.kcp.co.kr/services/KCPPaymentService"/>
</wsdl:port>
<wsdl:port name="PayServiceHttpSoap12Endpoint" binding="ns:PayServiceSoap12Binding">
<soap12:address location="https://devpggw.kcp.co.kr:8100/services/KCPPaymentService"/>
<soap12:address location="https://testsmpay.kcp.co.kr/services/KCPPaymentService"/>
</wsdl:port>
<wsdl:port name="PayServiceHttpEndpoint" binding="ns:PayServiceHttpBinding">
<http:address location="https://devpggw.kcp.co.kr:8100/services/KCPPaymentService"/>
<http:address location="https://testsmpay.kcp.co.kr/services/KCPPaymentService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
+18 -1
View File
@@ -9,7 +9,6 @@
/* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */
/* ============================================================================== */
/* ============================================================================== */
/* = 환경 설정 파일 Include = */
/* = -------------------------------------------------------------------------- = */
@@ -110,6 +109,24 @@
/* = -------------------------------------------------------------------------- = */
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_info = isset($_POST["enc_info"]) ? $_POST["enc_info"] : '';
+2 -2
View File
@@ -54,8 +54,8 @@ echo '<form name="forderform" method="post" action="'.$order_action_url.'" autoc
echo make_order_field($data, $exclude);
echo '<input type="hidden" name="res_cd" value="'.$LGD_RESPCODE.'">'.PHP_EOL;
echo '<input type="hidden" name="LGD_PAYKEY" value="'.$LGD_PAYKEY.'">'.PHP_EOL;
echo '<input type="hidden" name="res_cd" value="'.get_text($LGD_RESPCODE).'">'.PHP_EOL;
echo '<input type="hidden" name="LGD_PAYKEY" value="'.get_text($LGD_PAYKEY).'">'.PHP_EOL;
echo '</form>'.PHP_EOL;
?>
+5 -3
View File
@@ -80,6 +80,8 @@ $payReqMap['LGD_HASHDATA'] = $LGD_HASHDATA; // MD5 해쉬
$payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지
$payReqMap['LGD_VERSION'] = "PHP_SmartXPay_1.0"; // 버전정보 (삭제하지 마세요)
$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_ENCODING'] = "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']) { // 테스트 결제시 ?>
<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 { //실 결제시 ?>
<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 } ?>
<script type="text/javascript">
@@ -165,7 +167,7 @@ function getFormObject() {
<form method="post" name="LGD_PAYINFO" id="LGD_PAYINFO" action="">
<?php
foreach ($payReqMap as $key => $value) {
echo'"<input type="hidden" name="'.$key.'" id="'.$key.'" value="'.$value.'">';
echo'"<input type="hidden" name="'.get_text($key).'" id="'.get_text($key).'" value="'.get_text($value).'">';
}
?>
</form>
-2
View File
@@ -4,8 +4,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 나이스페이 공통 설정
require_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
if (function_exists('add_log')) add_log($_POST);
/*
****************************************************************************************
* <Authentication Result Parameter>
@@ -2,8 +2,6 @@
include_once('./_common.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
$authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message
$mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id
+5
View File
@@ -1548,7 +1548,12 @@ function pay_approval()
return false;
}
<?php if ($default['de_pg_service'] == 'nicepay') { ?>
nicepayStart(f);
return false;
<?php } ?>
f.submit();
}
return false;
+9 -1
View File
@@ -698,6 +698,10 @@ if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY':
$_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount;
@@ -756,6 +760,10 @@ if(!$result) {
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY':
$_REQUEST['TID'] = $tno;
$_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_b_name, $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("{회사명}", $default['de_admin_company_name'], $sms_content);
-6
View File
@@ -361,12 +361,6 @@
<Execution method="windowOpen" value="Embed" />
</Attribute>
</Button>
<Button name="Map" tooltip="지도">
<Attribute class="cheditor-tb-bg" width="23" height="23">
<Icon position="694" width="16" class="cheditor-tb-icon" />
<Execution method="windowOpen" value="GoogleMap" />
</Attribute>
</Button>
</Group>
<Group name="PageBreak">
<Button name="PageBreak" tooltip="인쇄 쪽 나눔">
File diff suppressed because it is too large Load Diff
+27 -1
View File
@@ -8,7 +8,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
*/
if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
class HTMLPurifier_Filter_iframevideo extends HTMLPurifier_Filter
class HTMLPurifier_Filter_Iframevideo extends HTMLPurifier_Filter
{
public $name = 'Iframevideo';
@@ -77,4 +77,30 @@ if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
}
}
}
}
if( !class_exists('HTMLPurifierContinueParamFilter') ){
class HTMLPurifierContinueParamFilter extends HTMLPurifier_URIFilter
{
public $name = 'ContinueParamFilter';
public function filter(&$uri, $config, $context)
{
// 쿼리 파라미터 검사
$query = $uri->query;
$path = $uri->path;
if ($path && preg_match('#[\\\\/]logout#i', $path)) {
return false;
}
if ($query) {
if (isset($query_params['continue'])) {
return false;
}
}
return true; // 조건 통과 시 허용
}
}
}
@@ -1,15 +1,15 @@
AutoFormat.RemoveEmpty.RemoveNbsp
TYPE: bool
VERSION: 4.0.0
DEFAULT: false
--DESCRIPTION--
<p>
When enabled, HTML Purifier will treat any elements that contain only
non-breaking spaces as well as regular whitespace as empty, and remove
them when %AutoFormat.RemoveEmpty is enabled.
</p>
<p>
See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements
that don't have this behavior applied to them.
</p>
--# vim: et sw=4 sts=4
AutoFormat.RemoveEmpty.RemoveNbsp
TYPE: bool
VERSION: 4.0.0
DEFAULT: false
--DESCRIPTION--
<p>
When enabled, HTML Purifier will treat any elements that contain only
non-breaking spaces as well as regular whitespace as empty, and remove
them when %AutoFormat.RemoveEmpty is enabled.
</p>
<p>
See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements
that don't have this behavior applied to them.
</p>
--# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
Core.AllowParseManyTags
TYPE: bool
DEFAULT: false
VERSION: 4.10.1
--DESCRIPTION--
<p>
This directive allows parsing of many nested tags.
If you set true, relaxes any hardcoded limit from the parser.
However, in that case it may cause a Dos attack.
Be careful when enabling it.
</p>
--# vim: et sw=4 sts=4
Core.AllowParseManyTags
TYPE: bool
DEFAULT: false
VERSION: 4.10.1
--DESCRIPTION--
<p>
This directive allows parsing of many nested tags.
If you set true, relaxes any hardcoded limit from the parser.
However, in that case it may cause a Dos attack.
Be careful when enabling it.
</p>
--# vim: et sw=4 sts=4
@@ -1,160 +1,160 @@
Core.ColorKeywords
TYPE: hash
VERSION: 2.0.0
--DEFAULT--
array (
'aliceblue' => '#F0F8FF',
'antiquewhite' => '#FAEBD7',
'aqua' => '#00FFFF',
'aquamarine' => '#7FFFD4',
'azure' => '#F0FFFF',
'beige' => '#F5F5DC',
'bisque' => '#FFE4C4',
'black' => '#000000',
'blanchedalmond' => '#FFEBCD',
'blue' => '#0000FF',
'blueviolet' => '#8A2BE2',
'brown' => '#A52A2A',
'burlywood' => '#DEB887',
'cadetblue' => '#5F9EA0',
'chartreuse' => '#7FFF00',
'chocolate' => '#D2691E',
'coral' => '#FF7F50',
'cornflowerblue' => '#6495ED',
'cornsilk' => '#FFF8DC',
'crimson' => '#DC143C',
'cyan' => '#00FFFF',
'darkblue' => '#00008B',
'darkcyan' => '#008B8B',
'darkgoldenrod' => '#B8860B',
'darkgray' => '#A9A9A9',
'darkgrey' => '#A9A9A9',
'darkgreen' => '#006400',
'darkkhaki' => '#BDB76B',
'darkmagenta' => '#8B008B',
'darkolivegreen' => '#556B2F',
'darkorange' => '#FF8C00',
'darkorchid' => '#9932CC',
'darkred' => '#8B0000',
'darksalmon' => '#E9967A',
'darkseagreen' => '#8FBC8F',
'darkslateblue' => '#483D8B',
'darkslategray' => '#2F4F4F',
'darkslategrey' => '#2F4F4F',
'darkturquoise' => '#00CED1',
'darkviolet' => '#9400D3',
'deeppink' => '#FF1493',
'deepskyblue' => '#00BFFF',
'dimgray' => '#696969',
'dimgrey' => '#696969',
'dodgerblue' => '#1E90FF',
'firebrick' => '#B22222',
'floralwhite' => '#FFFAF0',
'forestgreen' => '#228B22',
'fuchsia' => '#FF00FF',
'gainsboro' => '#DCDCDC',
'ghostwhite' => '#F8F8FF',
'gold' => '#FFD700',
'goldenrod' => '#DAA520',
'gray' => '#808080',
'grey' => '#808080',
'green' => '#008000',
'greenyellow' => '#ADFF2F',
'honeydew' => '#F0FFF0',
'hotpink' => '#FF69B4',
'indianred' => '#CD5C5C',
'indigo' => '#4B0082',
'ivory' => '#FFFFF0',
'khaki' => '#F0E68C',
'lavender' => '#E6E6FA',
'lavenderblush' => '#FFF0F5',
'lawngreen' => '#7CFC00',
'lemonchiffon' => '#FFFACD',
'lightblue' => '#ADD8E6',
'lightcoral' => '#F08080',
'lightcyan' => '#E0FFFF',
'lightgoldenrodyellow' => '#FAFAD2',
'lightgray' => '#D3D3D3',
'lightgrey' => '#D3D3D3',
'lightgreen' => '#90EE90',
'lightpink' => '#FFB6C1',
'lightsalmon' => '#FFA07A',
'lightseagreen' => '#20B2AA',
'lightskyblue' => '#87CEFA',
'lightslategray' => '#778899',
'lightslategrey' => '#778899',
'lightsteelblue' => '#B0C4DE',
'lightyellow' => '#FFFFE0',
'lime' => '#00FF00',
'limegreen' => '#32CD32',
'linen' => '#FAF0E6',
'magenta' => '#FF00FF',
'maroon' => '#800000',
'mediumaquamarine' => '#66CDAA',
'mediumblue' => '#0000CD',
'mediumorchid' => '#BA55D3',
'mediumpurple' => '#9370DB',
'mediumseagreen' => '#3CB371',
'mediumslateblue' => '#7B68EE',
'mediumspringgreen' => '#00FA9A',
'mediumturquoise' => '#48D1CC',
'mediumvioletred' => '#C71585',
'midnightblue' => '#191970',
'mintcream' => '#F5FFFA',
'mistyrose' => '#FFE4E1',
'moccasin' => '#FFE4B5',
'navajowhite' => '#FFDEAD',
'navy' => '#000080',
'oldlace' => '#FDF5E6',
'olive' => '#808000',
'olivedrab' => '#6B8E23',
'orange' => '#FFA500',
'orangered' => '#FF4500',
'orchid' => '#DA70D6',
'palegoldenrod' => '#EEE8AA',
'palegreen' => '#98FB98',
'paleturquoise' => '#AFEEEE',
'palevioletred' => '#DB7093',
'papayawhip' => '#FFEFD5',
'peachpuff' => '#FFDAB9',
'peru' => '#CD853F',
'pink' => '#FFC0CB',
'plum' => '#DDA0DD',
'powderblue' => '#B0E0E6',
'purple' => '#800080',
'rebeccapurple' => '#663399',
'red' => '#FF0000',
'rosybrown' => '#BC8F8F',
'royalblue' => '#4169E1',
'saddlebrown' => '#8B4513',
'salmon' => '#FA8072',
'sandybrown' => '#F4A460',
'seagreen' => '#2E8B57',
'seashell' => '#FFF5EE',
'sienna' => '#A0522D',
'silver' => '#C0C0C0',
'skyblue' => '#87CEEB',
'slateblue' => '#6A5ACD',
'slategray' => '#708090',
'slategrey' => '#708090',
'snow' => '#FFFAFA',
'springgreen' => '#00FF7F',
'steelblue' => '#4682B4',
'tan' => '#D2B48C',
'teal' => '#008080',
'thistle' => '#D8BFD8',
'tomato' => '#FF6347',
'turquoise' => '#40E0D0',
'violet' => '#EE82EE',
'wheat' => '#F5DEB3',
'white' => '#FFFFFF',
'whitesmoke' => '#F5F5F5',
'yellow' => '#FFFF00',
'yellowgreen' => '#9ACD32'
)
--DESCRIPTION--
Lookup array of color names to six digit hexadecimal number corresponding
to color, with preceding hash mark. Used when parsing colors. The lookup
is done in a case-insensitive manner.
--# vim: et sw=4 sts=4
Core.ColorKeywords
TYPE: hash
VERSION: 2.0.0
--DEFAULT--
array (
'aliceblue' => '#F0F8FF',
'antiquewhite' => '#FAEBD7',
'aqua' => '#00FFFF',
'aquamarine' => '#7FFFD4',
'azure' => '#F0FFFF',
'beige' => '#F5F5DC',
'bisque' => '#FFE4C4',
'black' => '#000000',
'blanchedalmond' => '#FFEBCD',
'blue' => '#0000FF',
'blueviolet' => '#8A2BE2',
'brown' => '#A52A2A',
'burlywood' => '#DEB887',
'cadetblue' => '#5F9EA0',
'chartreuse' => '#7FFF00',
'chocolate' => '#D2691E',
'coral' => '#FF7F50',
'cornflowerblue' => '#6495ED',
'cornsilk' => '#FFF8DC',
'crimson' => '#DC143C',
'cyan' => '#00FFFF',
'darkblue' => '#00008B',
'darkcyan' => '#008B8B',
'darkgoldenrod' => '#B8860B',
'darkgray' => '#A9A9A9',
'darkgrey' => '#A9A9A9',
'darkgreen' => '#006400',
'darkkhaki' => '#BDB76B',
'darkmagenta' => '#8B008B',
'darkolivegreen' => '#556B2F',
'darkorange' => '#FF8C00',
'darkorchid' => '#9932CC',
'darkred' => '#8B0000',
'darksalmon' => '#E9967A',
'darkseagreen' => '#8FBC8F',
'darkslateblue' => '#483D8B',
'darkslategray' => '#2F4F4F',
'darkslategrey' => '#2F4F4F',
'darkturquoise' => '#00CED1',
'darkviolet' => '#9400D3',
'deeppink' => '#FF1493',
'deepskyblue' => '#00BFFF',
'dimgray' => '#696969',
'dimgrey' => '#696969',
'dodgerblue' => '#1E90FF',
'firebrick' => '#B22222',
'floralwhite' => '#FFFAF0',
'forestgreen' => '#228B22',
'fuchsia' => '#FF00FF',
'gainsboro' => '#DCDCDC',
'ghostwhite' => '#F8F8FF',
'gold' => '#FFD700',
'goldenrod' => '#DAA520',
'gray' => '#808080',
'grey' => '#808080',
'green' => '#008000',
'greenyellow' => '#ADFF2F',
'honeydew' => '#F0FFF0',
'hotpink' => '#FF69B4',
'indianred' => '#CD5C5C',
'indigo' => '#4B0082',
'ivory' => '#FFFFF0',
'khaki' => '#F0E68C',
'lavender' => '#E6E6FA',
'lavenderblush' => '#FFF0F5',
'lawngreen' => '#7CFC00',
'lemonchiffon' => '#FFFACD',
'lightblue' => '#ADD8E6',
'lightcoral' => '#F08080',
'lightcyan' => '#E0FFFF',
'lightgoldenrodyellow' => '#FAFAD2',
'lightgray' => '#D3D3D3',
'lightgrey' => '#D3D3D3',
'lightgreen' => '#90EE90',
'lightpink' => '#FFB6C1',
'lightsalmon' => '#FFA07A',
'lightseagreen' => '#20B2AA',
'lightskyblue' => '#87CEFA',
'lightslategray' => '#778899',
'lightslategrey' => '#778899',
'lightsteelblue' => '#B0C4DE',
'lightyellow' => '#FFFFE0',
'lime' => '#00FF00',
'limegreen' => '#32CD32',
'linen' => '#FAF0E6',
'magenta' => '#FF00FF',
'maroon' => '#800000',
'mediumaquamarine' => '#66CDAA',
'mediumblue' => '#0000CD',
'mediumorchid' => '#BA55D3',
'mediumpurple' => '#9370DB',
'mediumseagreen' => '#3CB371',
'mediumslateblue' => '#7B68EE',
'mediumspringgreen' => '#00FA9A',
'mediumturquoise' => '#48D1CC',
'mediumvioletred' => '#C71585',
'midnightblue' => '#191970',
'mintcream' => '#F5FFFA',
'mistyrose' => '#FFE4E1',
'moccasin' => '#FFE4B5',
'navajowhite' => '#FFDEAD',
'navy' => '#000080',
'oldlace' => '#FDF5E6',
'olive' => '#808000',
'olivedrab' => '#6B8E23',
'orange' => '#FFA500',
'orangered' => '#FF4500',
'orchid' => '#DA70D6',
'palegoldenrod' => '#EEE8AA',
'palegreen' => '#98FB98',
'paleturquoise' => '#AFEEEE',
'palevioletred' => '#DB7093',
'papayawhip' => '#FFEFD5',
'peachpuff' => '#FFDAB9',
'peru' => '#CD853F',
'pink' => '#FFC0CB',
'plum' => '#DDA0DD',
'powderblue' => '#B0E0E6',
'purple' => '#800080',
'rebeccapurple' => '#663399',
'red' => '#FF0000',
'rosybrown' => '#BC8F8F',
'royalblue' => '#4169E1',
'saddlebrown' => '#8B4513',
'salmon' => '#FA8072',
'sandybrown' => '#F4A460',
'seagreen' => '#2E8B57',
'seashell' => '#FFF5EE',
'sienna' => '#A0522D',
'silver' => '#C0C0C0',
'skyblue' => '#87CEEB',
'slateblue' => '#6A5ACD',
'slategray' => '#708090',
'slategrey' => '#708090',
'snow' => '#FFFAFA',
'springgreen' => '#00FF7F',
'steelblue' => '#4682B4',
'tan' => '#D2B48C',
'teal' => '#008080',
'thistle' => '#D8BFD8',
'tomato' => '#FF6347',
'turquoise' => '#40E0D0',
'violet' => '#EE82EE',
'wheat' => '#F5DEB3',
'white' => '#FFFFFF',
'whitesmoke' => '#F5F5F5',
'yellow' => '#FFFF00',
'yellowgreen' => '#9ACD32'
)
--DESCRIPTION--
Lookup array of color names to six digit hexadecimal number corresponding
to color, with preceding hash mark. Used when parsing colors. The lookup
is done in a case-insensitive manner.
--# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
HTML.Forms
TYPE: bool
VERSION: 4.13.0
DEFAULT: false
--DESCRIPTION--
<p>
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
enabling forms in untrusted documents may allow for phishing attacks.
</p>
--# vim: et sw=4 sts=4
HTML.Forms
TYPE: bool
VERSION: 4.13.0
DEFAULT: false
--DESCRIPTION--
<p>
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
enabling forms in untrusted documents may allow for phishing attacks.
</p>
--# vim: et sw=4 sts=4
File diff suppressed because it is too large Load Diff
@@ -1,451 +1,451 @@
<?php
/**
* @todo Rewrite to use Interchange objects
*/
class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
{
/**
* Printers for specific fields.
* @type HTMLPurifier_Printer[]
*/
protected $fields = array();
/**
* Documentation URL, can have fragment tagged on end.
* @type string
*/
protected $docURL;
/**
* Name of form element to stuff config in.
* @type string
*/
protected $name;
/**
* Whether or not to compress directive names, clipping them off
* after a certain amount of letters. False to disable or integer letters
* before clipping.
* @type bool
*/
protected $compress = false;
/**
* @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 bool $compress Integer max length before compressing a directive name, set to false to turn off
*/
public function __construct(
$name,
$doc_url = null,
$compress = false
) {
parent::__construct();
$this->docURL = $doc_url;
$this->name = $name;
$this->compress = $compress;
// initialize sub-printers
$this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default();
$this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool();
}
/**
* Sets default column and row size for textareas in sub-printers
* @param $cols Integer columns of textarea, null to use default
* @param $rows Integer rows of textarea, null to use default
*/
public function setTextareaDimensions($cols = null, $rows = null)
{
if ($cols) {
$this->fields['default']->cols = $cols;
}
if ($rows) {
$this->fields['default']->rows = $rows;
}
}
/**
* Retrieves styling, in case it is not accessible by webserver
*/
public static function getCSS()
{
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css');
}
/**
* Retrieves JavaScript, in case it is not accessible by webserver
*/
public static function getJavaScript()
{
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js');
}
/**
* Returns HTML output for a configuration form
* @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.
* @param array|bool $allowed Optional namespace(s) and directives to restrict form to.
* @param bool $render_controls
* @return string
*/
public function render($config, $allowed = true, $render_controls = true)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->config = $config;
$this->genConfig = $gen_config;
$this->prepareGenerator($gen_config);
$allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def);
$all = array();
foreach ($allowed as $key) {
list($ns, $directive) = $key;
$all[$ns][$directive] = $config->get($ns . '.' . $directive);
}
$ret = '';
$ret .= $this->start('table', array('class' => 'hp-config'));
$ret .= $this->start('thead');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Directive', array('class' => 'hp-directive'));
$ret .= $this->element('th', 'Value', array('class' => 'hp-value'));
$ret .= $this->end('tr');
$ret .= $this->end('thead');
foreach ($all as $ns => $directives) {
$ret .= $this->renderNamespace($ns, $directives);
}
if ($render_controls) {
$ret .= $this->start('tbody');
$ret .= $this->start('tr');
$ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls'));
$ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit'));
$ret .= '[<a href="?">Reset</a>]';
$ret .= $this->end('td');
$ret .= $this->end('tr');
$ret .= $this->end('tbody');
}
$ret .= $this->end('table');
return $ret;
}
/**
* Renders a single namespace
* @param $ns String namespace name
* @param array $directives array of directives to values
* @return string
*/
protected function renderNamespace($ns, $directives)
{
$ret = '';
$ret .= $this->start('tbody', array('class' => 'namespace'));
$ret .= $this->start('tr');
$ret .= $this->element('th', $ns, array('colspan' => 2));
$ret .= $this->end('tr');
$ret .= $this->end('tbody');
$ret .= $this->start('tbody');
foreach ($directives as $directive => $value) {
$ret .= $this->start('tr');
$ret .= $this->start('th');
if ($this->docURL) {
$url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL);
$ret .= $this->start('a', array('href' => $url));
}
$attr = array('for' => "{$this->name}:$ns.$directive");
// crop directive name if it's too long
if (!$this->compress || (strlen($directive) < $this->compress)) {
$directive_disp = $directive;
} else {
$directive_disp = substr($directive, 0, $this->compress - 2) . '...';
$attr['title'] = $directive;
}
$ret .= $this->element(
'label',
$directive_disp,
// component printers must create an element with this id
$attr
);
if ($this->docURL) {
$ret .= $this->end('a');
}
$ret .= $this->end('th');
$ret .= $this->start('td');
$def = $this->config->def->info["$ns.$directive"];
if (is_int($def)) {
$allow_null = $def < 0;
$type = abs($def);
} else {
$type = $def->type;
$allow_null = isset($def->allow_null);
}
if (!isset($this->fields[$type])) {
$type = 0;
} // default
$type_obj = $this->fields[$type];
if ($allow_null) {
$type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj);
}
$ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config));
$ret .= $this->end('td');
$ret .= $this->end('tr');
}
$ret .= $this->end('tbody');
return $ret;
}
}
/**
* Printer decorator for directives that accept null
*/
class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer
{
/**
* Printer being decorated
* @type HTMLPurifier_Printer
*/
protected $obj;
/**
* @param HTMLPurifier_Printer $obj Printer to decorate
*/
public function __construct($obj)
{
parent::__construct();
$this->obj = $obj;
}
/**
* @param string $ns
* @param string $directive
* @param string $value
* @param string $name
* @param HTMLPurifier_Config|array $config
* @return string
*/
public function render($ns, $directive, $value, $name, $config)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
$ret = '';
$ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Null/Disabled');
$ret .= $this->end('label');
$attr = array(
'type' => 'checkbox',
'value' => '1',
'class' => 'null-toggle',
'name' => "$name" . "[Null_$ns.$directive]",
'id' => "$name:Null_$ns.$directive",
'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!!
);
if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) {
// modify inline javascript slightly
$attr['onclick'] =
"toggleWriteability('$name:Yes_$ns.$directive',checked);" .
"toggleWriteability('$name:No_$ns.$directive',checked)";
}
if ($value === null) {
$attr['checked'] = 'checked';
}
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->text(' or ');
$ret .= $this->elementEmpty('br');
$ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config));
return $ret;
}
}
/**
* Swiss-army knife configuration form field printer
*/
class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer
{
/**
* @type int
*/
public $cols = 18;
/**
* @type int
*/
public $rows = 5;
/**
* @param string $ns
* @param string $directive
* @param string $value
* @param string $name
* @param HTMLPurifier_Config|array $config
* @return string
*/
public function render($ns, $directive, $value, $name, $config)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
// this should probably be split up a little
$ret = '';
$def = $config->def->info["$ns.$directive"];
if (is_int($def)) {
$type = abs($def);
} else {
$type = $def->type;
}
if (is_array($value)) {
switch ($type) {
case HTMLPurifier_VarParser::LOOKUP:
$array = $value;
$value = array();
foreach ($array as $val => $b) {
$value[] = $val;
}
//TODO does this need a break?
case HTMLPurifier_VarParser::ALIST:
$value = implode(PHP_EOL, $value);
break;
case HTMLPurifier_VarParser::HASH:
$nvalue = '';
foreach ($value as $i => $v) {
if (is_array($v)) {
// HACK
$v = implode(";", $v);
}
$nvalue .= "$i:$v" . PHP_EOL;
}
$value = $nvalue;
break;
default:
$value = '';
}
}
if ($type === HTMLPurifier_VarParser::C_MIXED) {
return 'Not supported';
$value = serialize($value);
}
$attr = array(
'name' => "$name" . "[$ns.$directive]",
'id' => "$name:$ns.$directive"
);
if ($value === null) {
$attr['disabled'] = 'disabled';
}
if (isset($def->allowed)) {
$ret .= $this->start('select', $attr);
foreach ($def->allowed as $val => $b) {
$attr = array();
if ($value == $val) {
$attr['selected'] = 'selected';
}
$ret .= $this->element('option', $val, $attr);
}
$ret .= $this->end('select');
} elseif ($type === HTMLPurifier_VarParser::TEXT ||
$type === HTMLPurifier_VarParser::ITEXT ||
$type === HTMLPurifier_VarParser::ALIST ||
$type === HTMLPurifier_VarParser::HASH ||
$type === HTMLPurifier_VarParser::LOOKUP) {
$attr['cols'] = $this->cols;
$attr['rows'] = $this->rows;
$ret .= $this->start('textarea', $attr);
$ret .= $this->text($value);
$ret .= $this->end('textarea');
} else {
$attr['value'] = $value;
$attr['type'] = 'text';
$ret .= $this->elementEmpty('input', $attr);
}
return $ret;
}
}
/**
* Bool form field printer
*/
class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer
{
/**
* @param string $ns
* @param string $directive
* @param string $value
* @param string $name
* @param HTMLPurifier_Config|array $config
* @return string
*/
public function render($ns, $directive, $value, $name, $config)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
$ret = '';
$ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
$ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Yes');
$ret .= $this->end('label');
$attr = array(
'type' => 'radio',
'name' => "$name" . "[$ns.$directive]",
'id' => "$name:Yes_$ns.$directive",
'value' => '1'
);
if ($value === true) {
$attr['checked'] = 'checked';
}
if ($value === null) {
$attr['disabled'] = 'disabled';
}
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->start('label', array('for' => "$name:No_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' No');
$ret .= $this->end('label');
$attr = array(
'type' => 'radio',
'name' => "$name" . "[$ns.$directive]",
'id' => "$name:No_$ns.$directive",
'value' => '0'
);
if ($value === false) {
$attr['checked'] = 'checked';
}
if ($value === null) {
$attr['disabled'] = 'disabled';
}
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->end('div');
return $ret;
}
}
// vim: et sw=4 sts=4
<?php
/**
* @todo Rewrite to use Interchange objects
*/
class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
{
/**
* Printers for specific fields.
* @type HTMLPurifier_Printer[]
*/
protected $fields = array();
/**
* Documentation URL, can have fragment tagged on end.
* @type string
*/
protected $docURL;
/**
* Name of form element to stuff config in.
* @type string
*/
protected $name;
/**
* Whether or not to compress directive names, clipping them off
* after a certain amount of letters. False to disable or integer letters
* before clipping.
* @type bool
*/
protected $compress = false;
/**
* @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 bool $compress Integer max length before compressing a directive name, set to false to turn off
*/
public function __construct(
$name,
$doc_url = null,
$compress = false
) {
parent::__construct();
$this->docURL = $doc_url;
$this->name = $name;
$this->compress = $compress;
// initialize sub-printers
$this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default();
$this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool();
}
/**
* Sets default column and row size for textareas in sub-printers
* @param $cols Integer columns of textarea, null to use default
* @param $rows Integer rows of textarea, null to use default
*/
public function setTextareaDimensions($cols = null, $rows = null)
{
if ($cols) {
$this->fields['default']->cols = $cols;
}
if ($rows) {
$this->fields['default']->rows = $rows;
}
}
/**
* Retrieves styling, in case it is not accessible by webserver
*/
public static function getCSS()
{
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css');
}
/**
* Retrieves JavaScript, in case it is not accessible by webserver
*/
public static function getJavaScript()
{
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js');
}
/**
* Returns HTML output for a configuration form
* @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.
* @param array|bool $allowed Optional namespace(s) and directives to restrict form to.
* @param bool $render_controls
* @return string
*/
public function render($config, $allowed = true, $render_controls = true)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->config = $config;
$this->genConfig = $gen_config;
$this->prepareGenerator($gen_config);
$allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def);
$all = array();
foreach ($allowed as $key) {
list($ns, $directive) = $key;
$all[$ns][$directive] = $config->get($ns . '.' . $directive);
}
$ret = '';
$ret .= $this->start('table', array('class' => 'hp-config'));
$ret .= $this->start('thead');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Directive', array('class' => 'hp-directive'));
$ret .= $this->element('th', 'Value', array('class' => 'hp-value'));
$ret .= $this->end('tr');
$ret .= $this->end('thead');
foreach ($all as $ns => $directives) {
$ret .= $this->renderNamespace($ns, $directives);
}
if ($render_controls) {
$ret .= $this->start('tbody');
$ret .= $this->start('tr');
$ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls'));
$ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit'));
$ret .= '[<a href="?">Reset</a>]';
$ret .= $this->end('td');
$ret .= $this->end('tr');
$ret .= $this->end('tbody');
}
$ret .= $this->end('table');
return $ret;
}
/**
* Renders a single namespace
* @param $ns String namespace name
* @param array $directives array of directives to values
* @return string
*/
protected function renderNamespace($ns, $directives)
{
$ret = '';
$ret .= $this->start('tbody', array('class' => 'namespace'));
$ret .= $this->start('tr');
$ret .= $this->element('th', $ns, array('colspan' => 2));
$ret .= $this->end('tr');
$ret .= $this->end('tbody');
$ret .= $this->start('tbody');
foreach ($directives as $directive => $value) {
$ret .= $this->start('tr');
$ret .= $this->start('th');
if ($this->docURL) {
$url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL);
$ret .= $this->start('a', array('href' => $url));
}
$attr = array('for' => "{$this->name}:$ns.$directive");
// crop directive name if it's too long
if (!$this->compress || (strlen($directive) < $this->compress)) {
$directive_disp = $directive;
} else {
$directive_disp = substr($directive, 0, $this->compress - 2) . '...';
$attr['title'] = $directive;
}
$ret .= $this->element(
'label',
$directive_disp,
// component printers must create an element with this id
$attr
);
if ($this->docURL) {
$ret .= $this->end('a');
}
$ret .= $this->end('th');
$ret .= $this->start('td');
$def = $this->config->def->info["$ns.$directive"];
if (is_int($def)) {
$allow_null = $def < 0;
$type = abs($def);
} else {
$type = $def->type;
$allow_null = isset($def->allow_null);
}
if (!isset($this->fields[$type])) {
$type = 0;
} // default
$type_obj = $this->fields[$type];
if ($allow_null) {
$type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj);
}
$ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config));
$ret .= $this->end('td');
$ret .= $this->end('tr');
}
$ret .= $this->end('tbody');
return $ret;
}
}
/**
* Printer decorator for directives that accept null
*/
class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer
{
/**
* Printer being decorated
* @type HTMLPurifier_Printer
*/
protected $obj;
/**
* @param HTMLPurifier_Printer $obj Printer to decorate
*/
public function __construct($obj)
{
parent::__construct();
$this->obj = $obj;
}
/**
* @param string $ns
* @param string $directive
* @param string $value
* @param string $name
* @param HTMLPurifier_Config|array $config
* @return string
*/
public function render($ns, $directive, $value, $name, $config)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
$ret = '';
$ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Null/Disabled');
$ret .= $this->end('label');
$attr = array(
'type' => 'checkbox',
'value' => '1',
'class' => 'null-toggle',
'name' => "$name" . "[Null_$ns.$directive]",
'id' => "$name:Null_$ns.$directive",
'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!!
);
if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) {
// modify inline javascript slightly
$attr['onclick'] =
"toggleWriteability('$name:Yes_$ns.$directive',checked);" .
"toggleWriteability('$name:No_$ns.$directive',checked)";
}
if ($value === null) {
$attr['checked'] = 'checked';
}
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->text(' or ');
$ret .= $this->elementEmpty('br');
$ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config));
return $ret;
}
}
/**
* Swiss-army knife configuration form field printer
*/
class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer
{
/**
* @type int
*/
public $cols = 18;
/**
* @type int
*/
public $rows = 5;
/**
* @param string $ns
* @param string $directive
* @param string $value
* @param string $name
* @param HTMLPurifier_Config|array $config
* @return string
*/
public function render($ns, $directive, $value, $name, $config)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
// this should probably be split up a little
$ret = '';
$def = $config->def->info["$ns.$directive"];
if (is_int($def)) {
$type = abs($def);
} else {
$type = $def->type;
}
if (is_array($value)) {
switch ($type) {
case HTMLPurifier_VarParser::LOOKUP:
$array = $value;
$value = array();
foreach ($array as $val => $b) {
$value[] = $val;
}
//TODO does this need a break?
case HTMLPurifier_VarParser::ALIST:
$value = implode(PHP_EOL, $value);
break;
case HTMLPurifier_VarParser::HASH:
$nvalue = '';
foreach ($value as $i => $v) {
if (is_array($v)) {
// HACK
$v = implode(";", $v);
}
$nvalue .= "$i:$v" . PHP_EOL;
}
$value = $nvalue;
break;
default:
$value = '';
}
}
if ($type === HTMLPurifier_VarParser::C_MIXED) {
return 'Not supported';
$value = serialize($value);
}
$attr = array(
'name' => "$name" . "[$ns.$directive]",
'id' => "$name:$ns.$directive"
);
if ($value === null) {
$attr['disabled'] = 'disabled';
}
if (isset($def->allowed)) {
$ret .= $this->start('select', $attr);
foreach ($def->allowed as $val => $b) {
$attr = array();
if ($value == $val) {
$attr['selected'] = 'selected';
}
$ret .= $this->element('option', $val, $attr);
}
$ret .= $this->end('select');
} elseif ($type === HTMLPurifier_VarParser::TEXT ||
$type === HTMLPurifier_VarParser::ITEXT ||
$type === HTMLPurifier_VarParser::ALIST ||
$type === HTMLPurifier_VarParser::HASH ||
$type === HTMLPurifier_VarParser::LOOKUP) {
$attr['cols'] = $this->cols;
$attr['rows'] = $this->rows;
$ret .= $this->start('textarea', $attr);
$ret .= $this->text($value);
$ret .= $this->end('textarea');
} else {
$attr['value'] = $value;
$attr['type'] = 'text';
$ret .= $this->elementEmpty('input', $attr);
}
return $ret;
}
}
/**
* Bool form field printer
*/
class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer
{
/**
* @param string $ns
* @param string $directive
* @param string $value
* @param string $name
* @param HTMLPurifier_Config|array $config
* @return string
*/
public function render($ns, $directive, $value, $name, $config)
{
if (is_array($config) && isset($config[0])) {
$gen_config = $config[0];
$config = $config[1];
} else {
$gen_config = $config;
}
$this->prepareGenerator($gen_config);
$ret = '';
$ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
$ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Yes');
$ret .= $this->end('label');
$attr = array(
'type' => 'radio',
'name' => "$name" . "[$ns.$directive]",
'id' => "$name:Yes_$ns.$directive",
'value' => '1'
);
if ($value === true) {
$attr['checked'] = 'checked';
}
if ($value === null) {
$attr['disabled'] = 'disabled';
}
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->start('label', array('for' => "$name:No_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' No');
$ret .= $this->end('label');
$attr = array(
'type' => 'radio',
'name' => "$name" . "[$ns.$directive]",
'id' => "$name:No_$ns.$directive",
'value' => '0'
);
if ($value === false) {
$attr['checked'] = 'checked';
}
if ($value === null) {
$attr['disabled'] = 'disabled';
}
$ret .= $this->elementEmpty('input', $attr);
$ret .= $this->end('div');
return $ret;
}
}
// vim: et sw=4 sts=4
@@ -1,324 +1,324 @@
<?php
class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
{
/**
* @type HTMLPurifier_HTMLDefinition, for easy access
*/
protected $def;
/**
* @param HTMLPurifier_Config $config
* @return string
*/
public function render($config)
{
$ret = '';
$this->config =& $config;
$this->def = $config->getHTMLDefinition();
$ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));
$ret .= $this->renderDoctype();
$ret .= $this->renderEnvironment();
$ret .= $this->renderContentSets();
$ret .= $this->renderInfo();
$ret .= $this->end('div');
return $ret;
}
/**
* Renders the Doctype table
* @return string
*/
protected function renderDoctype()
{
$doctype = $this->def->doctype;
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Doctype');
$ret .= $this->row('Name', $doctype->name);
$ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No');
$ret .= $this->row('Default Modules', implode(', ', $doctype->modules));
$ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules));
$ret .= $this->end('table');
return $ret;
}
/**
* Renders environment table, which is miscellaneous info
* @return string
*/
protected function renderEnvironment()
{
$def = $this->def;
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Environment');
$ret .= $this->row('Parent of fragment', $def->info_parent);
$ret .= $this->renderChildren($def->info_parent_def->child);
$ret .= $this->row('Block wrap name', $def->info_block_wrapper);
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Global attributes');
$ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0);
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Tag transforms');
$list = array();
foreach ($def->info_tag_transform as $old => $new) {
$new = $this->getClass($new, 'TagTransform_');
$list[] = "<$old> with $new";
}
$ret .= $this->element('td', $this->listify($list));
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre));
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post));
$ret .= $this->end('tr');
$ret .= $this->end('table');
return $ret;
}
/**
* Renders the Content Sets table
* @return string
*/
protected function renderContentSets()
{
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Content Sets');
foreach ($this->def->info_content_sets as $name => $lookup) {
$ret .= $this->heavyHeader($name);
$ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($lookup));
$ret .= $this->end('tr');
}
$ret .= $this->end('table');
return $ret;
}
/**
* Renders the Elements ($info) table
* @return string
*/
protected function renderInfo()
{
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Elements ($info)');
ksort($this->def->info);
$ret .= $this->heavyHeader('Allowed tags', 2);
$ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2));
$ret .= $this->end('tr');
foreach ($this->def->info as $name => $def) {
$ret .= $this->start('tr');
$ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2));
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Inline content');
$ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No');
$ret .= $this->end('tr');
if (!empty($def->excludes)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Excludes');
$ret .= $this->element('td', $this->listifyTagLookup($def->excludes));
$ret .= $this->end('tr');
}
if (!empty($def->attr_transform_pre)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre));
$ret .= $this->end('tr');
}
if (!empty($def->attr_transform_post)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post));
$ret .= $this->end('tr');
}
if (!empty($def->auto_close)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Auto closed by');
$ret .= $this->element('td', $this->listifyTagLookup($def->auto_close));
$ret .= $this->end('tr');
}
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Allowed attributes');
$ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0);
$ret .= $this->end('tr');
if (!empty($def->required_attr)) {
$ret .= $this->row('Required attributes', $this->listify($def->required_attr));
}
$ret .= $this->renderChildren($def->child);
}
$ret .= $this->end('table');
return $ret;
}
/**
* Renders a row describing the allowed children of an element
* @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element
* @return string
*/
protected function renderChildren($def)
{
$context = new HTMLPurifier_Context();
$ret = '';
$ret .= $this->start('tr');
$elements = array();
$attr = array();
if (isset($def->elements)) {
if ($def->type == 'strictblockquote') {
$def->validateChildren(array(), $this->config, $context);
}
$elements = $def->elements;
}
if ($def->type == 'chameleon') {
$attr['rowspan'] = 2;
} elseif ($def->type == 'empty') {
$elements = array();
} elseif ($def->type == 'table') {
$elements = array_flip(
array(
'col',
'caption',
'colgroup',
'thead',
'tfoot',
'tbody',
'tr'
)
);
}
$ret .= $this->element('th', 'Allowed children', $attr);
if ($def->type == 'chameleon') {
$ret .= $this->element(
'td',
'<em>Block</em>: ' .
$this->escape($this->listifyTagLookup($def->block->elements)),
null,
0
);
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element(
'td',
'<em>Inline</em>: ' .
$this->escape($this->listifyTagLookup($def->inline->elements)),
null,
0
);
} elseif ($def->type == 'custom') {
$ret .= $this->element(
'td',
'<em>' . ucfirst($def->type) . '</em>: ' .
$def->dtd_regex
);
} else {
$ret .= $this->element(
'td',
'<em>' . ucfirst($def->type) . '</em>: ' .
$this->escape($this->listifyTagLookup($elements)),
null,
0
);
}
$ret .= $this->end('tr');
return $ret;
}
/**
* Listifies a tag lookup table.
* @param array $array Tag lookup array in form of array('tagname' => true)
* @return string
*/
protected function listifyTagLookup($array)
{
ksort($array);
$list = array();
foreach ($array as $name => $discard) {
if ($name !== '#PCDATA' && !isset($this->def->info[$name])) {
continue;
}
$list[] = $name;
}
return $this->listify($list);
}
/**
* Listifies a list of objects by retrieving class names and internal state
* @param array $array List of objects
* @return string
* @todo Also add information about internal state
*/
protected function listifyObjectList($array)
{
ksort($array);
$list = array();
foreach ($array as $obj) {
$list[] = $this->getClass($obj, 'AttrTransform_');
}
return $this->listify($list);
}
/**
* Listifies a hash of attributes to AttrDef classes
* @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)
* @return string
*/
protected function listifyAttr($array)
{
ksort($array);
$list = array();
foreach ($array as $name => $obj) {
if ($obj === false) {
continue;
}
$list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>';
}
return $this->listify($list);
}
/**
* Creates a heavy header row
* @param string $text
* @param int $num
* @return string
*/
protected function heavyHeader($text, $num = 1)
{
$ret = '';
$ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));
$ret .= $this->end('tr');
return $ret;
}
}
// vim: et sw=4 sts=4
<?php
class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
{
/**
* @type HTMLPurifier_HTMLDefinition, for easy access
*/
protected $def;
/**
* @param HTMLPurifier_Config $config
* @return string
*/
public function render($config)
{
$ret = '';
$this->config =& $config;
$this->def = $config->getHTMLDefinition();
$ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));
$ret .= $this->renderDoctype();
$ret .= $this->renderEnvironment();
$ret .= $this->renderContentSets();
$ret .= $this->renderInfo();
$ret .= $this->end('div');
return $ret;
}
/**
* Renders the Doctype table
* @return string
*/
protected function renderDoctype()
{
$doctype = $this->def->doctype;
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Doctype');
$ret .= $this->row('Name', $doctype->name);
$ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No');
$ret .= $this->row('Default Modules', implode(', ', $doctype->modules));
$ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules));
$ret .= $this->end('table');
return $ret;
}
/**
* Renders environment table, which is miscellaneous info
* @return string
*/
protected function renderEnvironment()
{
$def = $this->def;
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Environment');
$ret .= $this->row('Parent of fragment', $def->info_parent);
$ret .= $this->renderChildren($def->info_parent_def->child);
$ret .= $this->row('Block wrap name', $def->info_block_wrapper);
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Global attributes');
$ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0);
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Tag transforms');
$list = array();
foreach ($def->info_tag_transform as $old => $new) {
$new = $this->getClass($new, 'TagTransform_');
$list[] = "<$old> with $new";
}
$ret .= $this->element('td', $this->listify($list));
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre));
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post));
$ret .= $this->end('tr');
$ret .= $this->end('table');
return $ret;
}
/**
* Renders the Content Sets table
* @return string
*/
protected function renderContentSets()
{
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Content Sets');
foreach ($this->def->info_content_sets as $name => $lookup) {
$ret .= $this->heavyHeader($name);
$ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($lookup));
$ret .= $this->end('tr');
}
$ret .= $this->end('table');
return $ret;
}
/**
* Renders the Elements ($info) table
* @return string
*/
protected function renderInfo()
{
$ret = '';
$ret .= $this->start('table');
$ret .= $this->element('caption', 'Elements ($info)');
ksort($this->def->info);
$ret .= $this->heavyHeader('Allowed tags', 2);
$ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2));
$ret .= $this->end('tr');
foreach ($this->def->info as $name => $def) {
$ret .= $this->start('tr');
$ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2));
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Inline content');
$ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No');
$ret .= $this->end('tr');
if (!empty($def->excludes)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Excludes');
$ret .= $this->element('td', $this->listifyTagLookup($def->excludes));
$ret .= $this->end('tr');
}
if (!empty($def->attr_transform_pre)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre));
$ret .= $this->end('tr');
}
if (!empty($def->attr_transform_post)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post));
$ret .= $this->end('tr');
}
if (!empty($def->auto_close)) {
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Auto closed by');
$ret .= $this->element('td', $this->listifyTagLookup($def->auto_close));
$ret .= $this->end('tr');
}
$ret .= $this->start('tr');
$ret .= $this->element('th', 'Allowed attributes');
$ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0);
$ret .= $this->end('tr');
if (!empty($def->required_attr)) {
$ret .= $this->row('Required attributes', $this->listify($def->required_attr));
}
$ret .= $this->renderChildren($def->child);
}
$ret .= $this->end('table');
return $ret;
}
/**
* Renders a row describing the allowed children of an element
* @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element
* @return string
*/
protected function renderChildren($def)
{
$context = new HTMLPurifier_Context();
$ret = '';
$ret .= $this->start('tr');
$elements = array();
$attr = array();
if (isset($def->elements)) {
if ($def->type == 'strictblockquote') {
$def->validateChildren(array(), $this->config, $context);
}
$elements = $def->elements;
}
if ($def->type == 'chameleon') {
$attr['rowspan'] = 2;
} elseif ($def->type == 'empty') {
$elements = array();
} elseif ($def->type == 'table') {
$elements = array_flip(
array(
'col',
'caption',
'colgroup',
'thead',
'tfoot',
'tbody',
'tr'
)
);
}
$ret .= $this->element('th', 'Allowed children', $attr);
if ($def->type == 'chameleon') {
$ret .= $this->element(
'td',
'<em>Block</em>: ' .
$this->escape($this->listifyTagLookup($def->block->elements)),
null,
0
);
$ret .= $this->end('tr');
$ret .= $this->start('tr');
$ret .= $this->element(
'td',
'<em>Inline</em>: ' .
$this->escape($this->listifyTagLookup($def->inline->elements)),
null,
0
);
} elseif ($def->type == 'custom') {
$ret .= $this->element(
'td',
'<em>' . ucfirst($def->type) . '</em>: ' .
$def->dtd_regex
);
} else {
$ret .= $this->element(
'td',
'<em>' . ucfirst($def->type) . '</em>: ' .
$this->escape($this->listifyTagLookup($elements)),
null,
0
);
}
$ret .= $this->end('tr');
return $ret;
}
/**
* Listifies a tag lookup table.
* @param array $array Tag lookup array in form of array('tagname' => true)
* @return string
*/
protected function listifyTagLookup($array)
{
ksort($array);
$list = array();
foreach ($array as $name => $discard) {
if ($name !== '#PCDATA' && !isset($this->def->info[$name])) {
continue;
}
$list[] = $name;
}
return $this->listify($list);
}
/**
* Listifies a list of objects by retrieving class names and internal state
* @param array $array List of objects
* @return string
* @todo Also add information about internal state
*/
protected function listifyObjectList($array)
{
ksort($array);
$list = array();
foreach ($array as $obj) {
$list[] = $this->getClass($obj, 'AttrTransform_');
}
return $this->listify($list);
}
/**
* Listifies a hash of attributes to AttrDef classes
* @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)
* @return string
*/
protected function listifyAttr($array)
{
ksort($array);
$list = array();
foreach ($array as $name => $obj) {
if ($obj === false) {
continue;
}
$list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>';
}
return $this->listify($list);
}
/**
* Creates a heavy header row
* @param string $text
* @param int $num
* @return string
*/
protected function heavyHeader($text, $num = 1)
{
$ret = '';
$ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));
$ret .= $this->end('tr');
return $ret;
}
}
// vim: et sw=4 sts=4
+12
View File
@@ -1,8 +1,12 @@
<?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) : '';
$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") {
@@ -41,6 +45,14 @@ if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
$birth_day = $res_data['userBirthday']; // 생년월일
$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); // 인증성공 시 내역 기록
if(!$phone_no)
+18 -17
View File
@@ -9,15 +9,16 @@ if(empty($max_cr_id)) $max_cr_id = 0;
if($config['cf_cert_use'] == 2) { // 실서비스 일때
$mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
$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'); // 금일 인증시도 횟수 체크
} else { // 테스트 일때
$mid = "SRAiasTest";
$apiKey = "43700dfd4c795fe9550853aef3b6aaf1";
$mTxId ='SIR_'.$max_cr_id;
$mTxId ='SIR_'.substr($max_cr_id.'_'.round(microtime(true) * 1000), 0, 16);
}
$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);
@@ -57,22 +58,22 @@ $g5['title'] = 'KG이니시스 간편인증';
include_once(G5_PATH.'/head.sub.php');
?>
<form name="saForm">
<input type="hidden" name="mid" value="<?php echo $mid ?>"> <!-- 필수 값 -->
<input type="hidden" name="reqSvcCd" value="<?php echo $reqSvcCd ?>"> <!-- 필수 값 -->
<input type="hidden" name="mTxId" value="<?php echo $mTxId ?>"> <!-- 필수 값 -->
<input type="hidden" name="mid" value="<?php echo get_text($mid); ?>"> <!-- 필수 값 -->
<input type="hidden" name="reqSvcCd" value="<?php echo get_text($reqSvcCd); ?>"> <!-- 필수 값 -->
<input type="hidden" name="mTxId" value="<?php echo get_text($mTxId); ?>"> <!-- 필수 값 -->
<input type="hidden" name="authHash" value="<?php echo $authHash ?>"> <!-- 필수 값 -->
<input type="hidden" name="flgFixedUser" value="<?php echo $flgFixedUser ?>"> <!-- 필수 값 Y/N 특정사용자 인증 요청 여부 -->
<input type="hidden" name="userName" value="<?php echo $userName ?>">
<input type="hidden" name="userPhone" value="<?php echo $userPhone ?>">
<input type="hidden" name="userBirth" value="<?php echo $userBirth ?>">
<input type="hidden" name="userHash" value="<?php echo $userHash ?>">
<input type="hidden" name="reservedMsg" value="<?php echo $reservedMsg; ?>">
<input type="hidden" name="mbId" value="<?php echo $member['mb_id']; ?>">
<input type="hidden" name="directAgency" value="<?php echo isset($_GET['directAgency']) ? clean_xss_tags($_GET['directAgency'], 1, 1) : ''; ?>">
<input type="hidden" name="authHash" value="<?php echo get_text($authHash); ?>"> <!-- 필수 값 -->
<input type="hidden" name="flgFixedUser" value="<?php echo get_text($flgFixedUser); ?>"> <!-- 필수 값 Y/N 특정사용자 인증 요청 여부 -->
<input type="hidden" name="userName" value="<?php echo get_text($userName); ?>">
<input type="hidden" name="userPhone" value="<?php echo get_text($userPhone); ?>">
<input type="hidden" name="userBirth" value="<?php echo get_text($userBirth); ?>">
<input type="hidden" name="userHash" value="<?php echo get_text($userHash); ?>">
<input type="hidden" name="reservedMsg" value="<?php echo get_text($reservedMsg); ?>">
<input type="hidden" name="mbId" value="<?php echo get_text($member['mb_id']); ?>">
<input type="hidden" name="directAgency" value="<?php echo isset($_GET['directAgency']) ? get_text(clean_xss_tags($_GET['directAgency'], 1, 1)) : ''; ?>">
<input type="hidden" name="successUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
<input type="hidden" name="failUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
<input type="hidden" name="successUrl" value="<?php echo get_text($resultUrl); ?>"> <!-- 필수 값 -->
<input type="hidden" name="failUrl" value="<?php echo get_text($resultUrl); ?>"> <!-- 필수 값 -->
<!-- successUrl / failUrl 은 분리 하여 이용가능!-->
</form>
<script>
+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) : '';
$mid = substr($txId, 6, 10);
$SEEDKEY = isset($_POST['token']) ? clean_xss_tags($_POST['token'], 1, 1) : '';
$SEEDIV = "SASKGINICIS00000";
$SEEDIV = 'SASHOSTSIRIAS000';
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']; // 생년월일
$ci = $res_data['userCi']; // CI
// 개인정보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);
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); // 인증성공 시 내역 기록
+2 -1
View File
@@ -67,10 +67,11 @@ function decrypt_SEED($str, $bszUser_key, $bszIV) {
$pdwRoundKey = array_pad(array(), 32, 0);
$bszPlainText = null;
$planBytresMessage = array();
// 방법 1
$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]);
}
return Hex2String($planBytresMessage);
+3 -2
View File
@@ -171,7 +171,7 @@ if (!defined('_KISA_SEED_KEY_')) {
var $key_data = null;
function KISA_SEED_KEY() {
function __construct() {
$this->key_data = array_pad(array(), 32, 0);
}
@@ -192,7 +192,7 @@ if (!defined('_KISA_SEED_INFO_')) {
var $cbc_last_block = null;
var $last_block_flag = 0;
function KISA_SEED_INFO() {
function __construct() {
$this->ivec = array_pad(array(), 4, 0);
$this->seed_key = new KISA_SEED_KEY();
$this->cbc_buffer = array_pad(array(), 4, 0);
@@ -782,6 +782,7 @@ class KISA_SEED_CBC {
$pbszCipherText = array_pad(array(), $message_length, 0);
Common::arraycopy_system($message, $message_offset, $pbszCipherText, 0, $message_length);
$nCipherTextLen = count($pbszCipherText);
$result = null;
if ($nCipherTextLen % KISA_SEED_CBC::BLOCK_SIZE_SEED) {
return $result;
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+20 -7
View File
@@ -68,6 +68,11 @@ for($i=0; $i<count($key); $i++)
$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" )
{
$dn_hash = f_get_parm_str ( $valParam );
@@ -97,17 +102,25 @@ if( $cert_enc_use == "Y" )
// KCP 가 리턴해 드리는 dn_hash 와 사이트 코드, 주문번호 , 인증번호를 검증하여
// 해당 데이터의 위변조를 방지합니다
$veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호
if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" )
$enc_cert_real_data = $enc_cert_data2;
$bin_path = 'bin';
if ((int)$config['cf_cert_use'] === 2 && !$config['cf_cert_kcp_enckey']) {
$bin_path = 'bin_old';
$enc_cert_real_data = $enc_cert_data;
}
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(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = '/bin/ct_cli';
$bin_exe = '/'.$bin_path.'/ct_cli';
else
$bin_exe = '/bin/ct_cli_x64';
$bin_exe = '/'.$bin_path.'/ct_cli_x64';
} else {
$bin_exe = '/bin/ct_cli_exe.exe';
$bin_exe = '/'.$bin_path.'/ct_cli_exe.exe';
}
echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH.$bin_exe." 파일에 실행권한이 있는지 확인하세요.)";
@@ -116,13 +129,13 @@ if( $cert_enc_use == "Y" )
}
// 가맹점 DB 처리 페이지 영역
// 인증데이터 복호화 함수
// 해당 함수는 암호화된 enc_cert_data 를
// site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다.
// 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다.
$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_real_data , $opt );
$comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드
$phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호
+3
View File
@@ -14,12 +14,15 @@ $web_siteid = '';
if ($config['cf_cert_use'] == 2) { // 실서비스
$site_cd = 'SM'.$config['cf_cert_kcp_cd'];
$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) { // 테스트사용
$site_cd = 'S6186';
$cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp';
$kcp_enc_key = 'E66DCEB95BFBD45DF9DFAEEBCB092B5DC2EB3BF0';
} else { // 사용안함
$site_cd = '';
$cert_url = '';
$kcp_enc_key = '';
}
if(!$site_cd)
+12 -1
View File
@@ -27,6 +27,8 @@ if(!$ordr_idxx)
$ct_cert = new C_CT_CLI;
$ct_cert->mf_clear();
$sbParam = '';
$year = "00";
$month = "00";
$day = "00";
@@ -47,7 +49,7 @@ $hash_data = $site_cd .
$sex_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();
?>
@@ -101,10 +103,19 @@ $ct_cert->mf_clear();
<!-- up_hash 검증 을 위한 필드 -->
<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_2" value="opt2"/>
<input type="hidden" name="param_opt_3" value="opt3"/>
<?php if ($config['cf_cert_kcp_enckey'] || $kcp_enc_key) { ?>
<!-- 리턴 암호화 고도화 -->
<input type="hidden" name="cert_enc_use_ext" value="Y"/>
<input type='hidden' name='kcp_cert_lib_ver' value="<?php echo $ct_cert->get_kcp_lib_ver( $home_dir ); ?>"/>
<?php } ?>
</form>
<script>
+20 -6
View File
@@ -12,6 +12,7 @@ $enc_data = "";
$req_tx = "";
$enc_cert_data = "";
$enc_cert_data2 = "";
$cert_info = "";
$tran_cd = "";
@@ -67,6 +68,11 @@ for($i=0; $i<count($key); $i++)
{
$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" )
{
@@ -98,16 +104,24 @@ if( $cert_enc_use == "Y" )
// 해당 데이터의 위변조를 방지합니다
$veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호
if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" )
$enc_cert_real_data = $enc_cert_data2;
$bin_path = 'bin';
if ((int)$config['cf_cert_use'] === 2 && !$config['cf_cert_kcp_enckey']) {
$bin_path = 'bin_old';
$enc_cert_real_data = $enc_cert_data;
}
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(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = '/bin/ct_cli';
$bin_exe = '/'.$bin_path.'/ct_cli';
else
$bin_exe = '/bin/ct_cli_x64';
$bin_exe = '/'.$bin_path.'/ct_cli_x64';
} else {
$bin_exe = '/bin/ct_cli_exe.exe';
$bin_exe = '/'.$bin_path.'/ct_cli_exe.exe';
}
echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH.$bin_exe." 파일에 실행권한이 있는지 확인하세요.)";
@@ -116,13 +130,13 @@ if( $cert_enc_use == "Y" )
}
// 가맹점 DB 처리 페이지 영역
// 인증데이터 복호화 함수
// 해당 함수는 암호화된 enc_cert_data 를
// site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다.
// 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다.
$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_real_data , $opt );
$comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드
$phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호
+105 -37
View File
@@ -18,22 +18,39 @@ class C_CT_CLI
{
$this->m_dec_data="";
}
function get_bin_dirname()
{
global $config;
$bin_path = ((int)$config['cf_cert_use'] === 2 && !$config['cf_cert_kcp_enckey']) ? 'bin_old' : 'bin';
return $bin_path;
}
// 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(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = $home_dir . '/bin/ct_cli';
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli';
else
$bin_exe = $home_dir . '/bin/ct_cli_x64';
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli_x64';
} else {
$bin_exe = $home_dir . '/bin/ct_cli_exe.exe';
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli_exe.exe';
}
if ($key) {
$hash_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__make_hash_data",
$key,
$str
);
} else {
$hash_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__make_hash_data",
$str
);
}
$hash_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__make_hash_data",
$str
);
if ( $hash_data == "" ) { $hash_data = "HS01"; }
@@ -41,21 +58,31 @@ class C_CT_CLI
}
// 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(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = $home_dir . '/bin/ct_cli';
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli';
else
$bin_exe = $home_dir . '/bin/ct_cli_x64';
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli_x64';
} else {
$bin_exe = $home_dir . '/bin/ct_cli_exe.exe';
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli_exe.exe';
}
if ($key) {
$ret_val = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__check_valid_hash" ,
$key,
$hash_data ,
$str
);
} else {
$ret_val = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__check_valid_hash" ,
$hash_data ,
$str
);
}
$ret_val = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__check_valid_hash" ,
$hash_data ,
$str
);
if ( $ret_val == "" ) { $ret_val = "HS02"; }
@@ -63,31 +90,52 @@ 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(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = $home_dir . '/bin/ct_cli';
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli';
else
$bin_exe = $home_dir . '/bin/ct_cli_x64';
$dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" ,
$site_cd ,
$cert_no ,
$enc_cert_data ,
$opt
);
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli_x64';
if ($key) {
$dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" ,
$key,
$site_cd ,
$cert_no ,
$enc_cert_data ,
$opt
);
} else {
$dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" ,
$site_cd ,
$cert_no ,
$enc_cert_data ,
$opt
);
}
} else {
$bin_exe = $home_dir . '/bin/ct_cli_exe.exe';
$dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" ,
$site_cd ,
$cert_no ,
$enc_cert_data
);
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli_exe.exe';
if ($key) {
$dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" ,
$key,
$site_cd ,
$cert_no ,
$enc_cert_data
);
} else {
$dec_data = $this -> mf_exec( $bin_exe ,
"lf_CT_CLI__decrypt_enc_cert" ,
$site_cd ,
$cert_no ,
$enc_cert_data
);
}
}
if ( $dec_data == "" ) { $dec_data = "HS03"; }
@@ -96,6 +144,26 @@ class C_CT_CLI
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 . '/'.$this->get_bin_dirname().'/ct_cli';
else
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/ct_cli_x64';
} else {
$bin_exe = $home_dir . '/'.$this->get_bin_dirname().'/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
function mf_get_key_value( $name )
{
+1 -1
View File
@@ -111,7 +111,7 @@ $_SESSION['lgd_certify'] = $payReqMap;
<title>LG유플러스 전자결제 본인확인서비스</title>
<!-- 고객사 사이트가 https인 경우는 아래 http://을 https:// 으로 변경하시면 됩니다. -->
<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">
+2 -3
View File
@@ -1,3 +1,2 @@
url = https://xpayclient.lgdacom.net/xpay/Gateway.do
test_url = https://pretestclient.uplus.co.kr:9443/xpay/Gateway.do
aux_url = http://xpayclient.lgdacom.net:7080/xpay/Gateway.do
url = https://xpay-gateway.tosspayments.com/xpay/Gateway.do
test_url = https://xpay-gateway-sandbox.tosspayments.com/xpay/Gateway.do
+1 -1
View File
@@ -59,7 +59,7 @@ $payReqMap = $_SESSION['lgd_certify'];//결제 요청시, Session에 저장했
foreach ($payReqMap as $key => $value) {
$key = htmlspecialchars(strip_tags($key));
$value = htmlspecialchars(strip_tags($value));
echo "<input type='hidden' name='$key' id='$key' value='$value'>";
echo "<input type='hidden' name='".get_text($key)."' id='".get_text($key)."' value='".get_text($value)."'>";
}
?>
</form>
+9 -7
View File
@@ -22,18 +22,20 @@
Contact @<a href='http://twitter.com/abraham'>abraham</a>
</p>
<hr />
<?php if (isset($menu)) { ?>
<?php echo $menu; ?>
<?php if (isset($menu) && is_string($menu)) { ?>
<?php echo htmlspecialchars($menu, ENT_QUOTES, 'UTF-8'); ?>
<?php } ?>
</div>
<?php if (isset($status_text)) { ?>
<?php echo '<h3>'.$status_text.'</h3>'; ?>
<?php if (isset($status_text) && is_string($status_text)) { ?>
<?php echo '<h3>'.htmlspecialchars($status_text, ENT_QUOTES, 'UTF-8').'</h3>'; ?>
<?php } ?>
<p>
<div>
<pre>
<?php print_r($content); ?>
<?php if (isset($content) && (is_array($content) || is_object($content))) {
echo htmlspecialchars(json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), ENT_QUOTES, 'UTF-8');
} ?>
</pre>
</p>
</div>
</body>
</html>
+3 -2
View File
@@ -20,8 +20,8 @@ class OAuth1Client{
public $redirect_uri = "";
public $decode_json = true;
public $curl_time_out = 30;
public $curl_connect_time_out = 30;
public $curl_time_out = 10;
public $curl_connect_time_out = 15;
public $curl_ssl_verifypeer = false;
public $curl_auth_header = true;
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_CONNECTTIMEOUT, $this->curl_connect_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_HTTPHEADER , array('Expect:') );
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 $curl_time_out = 30;
public $curl_connect_time_out = 30;
public $curl_time_out = 10;
public $curl_connect_time_out = 15;
public $curl_ssl_verifypeer = false;
public $curl_ssl_verifyhost = false;
public $curl_header = array();
@@ -221,6 +221,7 @@ class OAuth2Client
curl_setopt($ch, CURLOPT_TIMEOUT , $this->curl_time_out );
curl_setopt($ch, CURLOPT_USERAGENT , $this->curl_useragent );
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_VERIFYHOST , $this->curl_ssl_verifyhost );
curl_setopt($ch, CURLOPT_HTTPHEADER , $this->curl_header );
+1 -1
View File
@@ -151,7 +151,7 @@ function social_before_join_check($url=''){
return false;
}
function social_get_data($by='provider', $provider, $user_profile){
function social_get_data($by, $provider, $user_profile){
global $g5;
// 소셜 가입이 되어 있는지 체크
+4 -11
View File
@@ -82,17 +82,10 @@ if( !isset($g5['g5_shop_post_log_table']) || !$g5['g5_shop_post_log_table'] ){
// 옵션 ID 특수문자 필터링 패턴
define('G5_OPTION_ID_FILTER', '/[\'\"\\\'\\\"]/');
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') {
// 토스페이먼츠 현금영수증 실결제 URL 상수
define('SHOP_TOSSPAYMENTS_CASHRECEIPT_REAL_JS', 'https://pgweb.tosspayments.com/WEB_SERVER/js/receipt_link.js');
// 토스페이먼츠 현금영수증 테스트 URL 상수
define('SHOP_TOSSPAYMENTS_CASHRECEIPT_TEST_JS', 'https://pgweb.tosspayments.com:7085/WEB_SERVER/js/receipt_link.js');
} else {
// 토스페이먼츠 현금영수증 실결제 URL 상수
define('SHOP_TOSSPAYMENTS_CASHRECEIPT_REAL_JS', 'http://pgweb.tosspayments.com/WEB_SERVER/js/receipt_link.js');
// 토스페이먼츠 현금영수증 테스트 URL 상수
define('SHOP_TOSSPAYMENTS_CASHRECEIPT_TEST_JS', 'http://pgweb.tosspayments.com:7085/WEB_SERVER/js/receipt_link.js');
}
// 토스페이먼츠 현금영수증 실결제 URL 상수
define('SHOP_TOSSPAYMENTS_CASHRECEIPT_REAL_JS', 'https://pgweb.tosspayments.com/WEB_SERVER/js/receipt_link.js');
// 토스페이먼츠 현금영수증 테스트 URL 상수
define('SHOP_TOSSPAYMENTS_CASHRECEIPT_TEST_JS', 'https://pgweb.tosspayments.com:7085/WEB_SERVER/js/receipt_link.js');
// 네이버페이를 신용카드 결제창에서 지원하고 있으므로 네이버에 직접신청하는 결제 기능을 미사용(false:기본설정) 합니다. (kagla,211019)
// 네이버에서 직접신청 결제를 사용(true)하시는 경우 모든 문제를 직접 해결해 주셔야 합니다.
+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_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();
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++) {
// 보관함의 상품을 담을 때 체크되지 않은 상품 건너뜀
if($act == 'multi' && ! (isset($post_chk_it_id[$i]) && $post_chk_it_id[$i]))
@@ -180,10 +185,6 @@ else // 장바구니에 담기
if(!$it['it_id'])
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']) {
$sum_qty = 0;
+35 -14
View File
@@ -3,9 +3,12 @@ include_once('./_common.php');
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
require_once(G5_SHOP_PATH.'/inicis/libs/HttpClient.php');
require_once(G5_SHOP_PATH.'/inicis/libs/json_lib.php');
require_once(G5_SHOP_PATH.'/inicis/libs/properties.php');
$inicis_pay_result = false;
$prop = new properties();
try {
//#############################
@@ -37,6 +40,18 @@ try {
///$mKey = $util->makeHash(signKey, "sha256"); // 가맹점 확인을 위한 signKey를 해시값으로 변경 (SHA-256방식 사용)
$mKey = hash("sha256", $signKey);
//##########################################################################
// 승인요청 API url (authUrl) 리스트 는 properties 에 세팅하여 사용합니다.
// idc_name 으로 수신 받은 센터 네임을 properties 에서 include 하여 승인요청하시면 됩니다.
//##########################################################################
$idc_name = $_REQUEST["idc_name"];
$authUrl = $prop->getAuthUrl($idc_name);
if (strcmp($authUrl, $_REQUEST["authUrl"]) != 0) {
die("authUrl check Fail\n");
}
//#####################
// 2.signature 생성
//#####################
@@ -172,22 +187,28 @@ try {
//#####################
$netcancelResultString = ""; // 망취소 요청 API url(고정, 임의 세팅 금지)
if ($httpUtil->processHTTP($netCancel, $authMap)) {
$netcancelResultString = $httpUtil->body;
} else {
echo "Http Connect Error\n";
echo $httpUtil->errormsg;
$netCancel = $prop->getNetCancel($idc_name);
if (strcmp($netCancel, $_REQUEST["netCancelUrl"]) == 0) {
if ($httpUtil->processHTTP($netCancel, $authMap)) {
$netcancelResultString = $httpUtil->body;
} else {
echo "Http Connect Error\n";
echo $httpUtil->errormsg;
throw new Exception("Http Connect Error");
throw new Exception("Http Connect Error");
}
echo "<br/>## 망취소 API 결과 ##<br/>";
/*##XML output##*/
//$netcancelResultString = str_replace("<", "&lt;", $$netcancelResultString);
//$netcancelResultString = str_replace(">", "&gt;", $$netcancelResultString);
// 취소 결과 확인
echo "<p>". $netcancelResultString . "</p>";
}
echo "## 망취소 API 결과 ##";
$netcancelResultString = str_replace("<", "&lt;", $$netcancelResultString);
$netcancelResultString = str_replace(">", "&gt;", $$netcancelResultString);
echo "<pre>", $netcancelResultString . "</pre>";
// 취소 결과 확인
}
} else {
+42
View File
@@ -0,0 +1,42 @@
<?php
class properties {
function getAuthUrl($idc_name) {
$url = "stdpay.inicis.com/api/payAuth";
switch ($idc_name) {
case 'fc':
$authUrl = "https://fc".$url;
break;
case 'ks':
$authUrl = "https://ks".$url;
break;
case 'stg':
$authUrl = "https://stg".$url;
break;
default:
break;
}
return $authUrl;
}
function getNetCancel($idc_name) {
$url = "stdpay.inicis.com/api/netCancel";
switch ($idc_name) {
case 'fc':
$netCancel = "https://fc".$url;
break;
case 'ks':
$netCancel = "https://ks".$url;
break;
case 'stg':
$netCancel = "https://stg".$url;
break;
default:
break;
}
return $netCancel;
}
}
?>
+16 -1
View File
@@ -146,7 +146,22 @@ 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_info = isset($_POST['enc_info']) ? $_POST['enc_info'] : '';

Some files were not shown because too many files have changed in this diff Show More