Compare commits

..
22 Commits
Author SHA1 Message Date
chicpro ad67fca323 파일면 변경으로인한 중복 파일 삭제 2015-11-17 16:39:16 +09:00
chicpro 614dce643c 캡챠 오류 수정 및 파일명 변경 2015-11-17 16:37:30 +09:00
chicpro c0cd45cc18 캡챠이미지 경로 오류수정 2015-11-17 09:07:12 +09:00
chicpro f3e7dbbb43 5.1.7 버전 변경 2015-11-16 16:45:37 +09:00
chicpro 5247359e39 오타 수정 2015-11-16 16:39:09 +09:00
chicpro 4ed4938cf1 캡챠 및 회원가입 값체크 개선 2015-11-16 16:36:04 +09:00
chicpro 158d9040d2 접속자 Browscap 적용 기능 개선 2015-11-13 11:23:14 +09:00
sora90224andchicpro aebfc70b10 불필요한 소스 삭제 2015-11-12 09:38:41 +09:00
chicpro 69ca119b10 업로드 파일명 코드 변경 2015-11-11 11:41:46 +09:00
chicpro be15f890c9 5.1.6 버전변경 2015-11-09 09:31:58 +09:00
chicproandchicpro bc71241846 php7 대응 코드 수정 2015-11-04 17:11:52 +09:00
chicpro 4bcce2696c sql_set_charset 함수 코드 수정 2015-11-04 10:20:42 +09:00
chicpro 7083bb0899 관리자 접속자 기능 개선 2015-11-03 15:35:31 +09:00
chicpro c7b1d0ee96 5.1.5 버전 변경 2015-11-02 09:54:40 +09:00
chicpro ba52e4ab6f 회원가입 개인정보취급방침 안내 수정 2015-10-29 09:59:29 +09:00
chicpro e47156ede6 게시판 복사 중 따옴표로 인한 오류 수정 2015-10-28 14:17:07 +09:00
chicpro 36ef8e6447 5.1.4 버전변경 2015-10-26 10:08:02 +09:00
chicpro eb154efa24 누락된 닫음태그 추가 2015-10-20 12:02:20 +09:00
chicpro 9bf15fdf32 htmlpurifier 4.7 버전 적용 2015-10-20 11:28:40 +09:00
chicpro 353a0d9409 XSS취약점관련 object 태그 허용설정 변경 2015-10-20 11:28:26 +09:00
chicpro 0535b6d26a post 값 필터링 코드 위치 변경 2015-10-20 11:26:30 +09:00
chicpro 1fe4684537 MySQLi 지원 추가 및 SMS5 수정 2015-10-16 10:12:06 +09:00
230 changed files with 33487 additions and 26991 deletions
+8 -2
View File
@@ -11,7 +11,13 @@ $menu['menu100'] = array (
array('100900', '캐시파일 일괄삭제',G5_ADMIN_URL.'/cache_file_delete.php', 'cf_cache', 1), array('100900', '캐시파일 일괄삭제',G5_ADMIN_URL.'/cache_file_delete.php', 'cf_cache', 1),
array('100910', '캡챠파일 일괄삭제',G5_ADMIN_URL.'/captcha_file_delete.php', 'cf_captcha', 1), array('100910', '캡챠파일 일괄삭제',G5_ADMIN_URL.'/captcha_file_delete.php', 'cf_captcha', 1),
array('100920', '썸네일파일 일괄삭제',G5_ADMIN_URL.'/thumbnail_file_delete.php', 'cf_thumbnail', 1), array('100920', '썸네일파일 일괄삭제',G5_ADMIN_URL.'/thumbnail_file_delete.php', 'cf_thumbnail', 1),
array('100500', 'phpinfo()', G5_ADMIN_URL.'/phpinfo.php', 'cf_phpinfo'), array('100500', 'phpinfo()', G5_ADMIN_URL.'/phpinfo.php', 'cf_phpinfo')
array('100400', '부가서비스', G5_ADMIN_URL.'/service.php', 'cf_service')
); );
if(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE) {
$menu['menu100'][] = array('100510', 'Browscap 업데이트', G5_ADMIN_URL.'/browscap.php', 'cf_browscap');
$menu['menu100'][] = array('100520', '접속로그 변환', G5_ADMIN_URL.'/browscap_convert.php', 'cf_visit_cnvrt');
}
$menu['menu100'][] = array('100400', '부가서비스', G5_ADMIN_URL.'/service.php', 'cf_service');
?> ?>
-1
View File
@@ -6,7 +6,6 @@ $menu["menu900"] = array (
array('900300', '문자 보내기', ''.G5_SMS5_ADMIN_URL.'/sms_write.php', 'sms_write'), array('900300', '문자 보내기', ''.G5_SMS5_ADMIN_URL.'/sms_write.php', 'sms_write'),
array('900400', '전송내역-건별', ''.G5_SMS5_ADMIN_URL.'/history_list.php', 'sms_history' , 1), array('900400', '전송내역-건별', ''.G5_SMS5_ADMIN_URL.'/history_list.php', 'sms_history' , 1),
array('900410', '전송내역-번호별', ''.G5_SMS5_ADMIN_URL.'/history_num.php', 'sms_history_num' , 1), array('900410', '전송내역-번호별', ''.G5_SMS5_ADMIN_URL.'/history_num.php', 'sms_history_num' , 1),
array('900450', '전송내역-회원', ''.G5_SMS5_ADMIN_URL.'/history_member.php', 'sms_history_mb' , 1),
array('900500', '이모티콘 그룹', ''.G5_SMS5_ADMIN_URL.'/form_group.php' , 'emoticon_group'), array('900500', '이모티콘 그룹', ''.G5_SMS5_ADMIN_URL.'/form_group.php' , 'emoticon_group'),
array('900600', '이모티콘 관리', ''.G5_SMS5_ADMIN_URL.'/form_list.php', 'emoticon_list'), array('900600', '이모티콘 관리', ''.G5_SMS5_ADMIN_URL.'/form_list.php', 'emoticon_list'),
array('900700', '휴대폰번호 그룹', ''.G5_SMS5_ADMIN_URL.'/num_group.php' , 'hp_group', 1), array('900700', '휴대폰번호 그룹', ''.G5_SMS5_ADMIN_URL.'/num_group.php' , 'hp_group', 1),
+20 -20
View File
@@ -95,26 +95,26 @@ $sql = " insert into {$g5['board_table']}
bo_use_cert = '{$board[bo_use_cert]}', bo_use_cert = '{$board[bo_use_cert]}',
bo_use_sns = '{$board[bo_use_sns]}', bo_use_sns = '{$board[bo_use_sns]}',
bo_sort_field = '{$board['bo_sort_field']}', bo_sort_field = '{$board['bo_sort_field']}',
bo_1_subj = '{$board['bo_1_subj']}', bo_1_subj = '".addslashes($board['bo_1_subj'])."',
bo_2_subj = '{$board['bo_2_subj']}', bo_2_subj = '".addslashes($board['bo_2_subj'])."',
bo_3_subj = '{$board['bo_3_subj']}', bo_3_subj = '".addslashes($board['bo_3_subj'])."',
bo_4_subj = '{$board['bo_4_subj']}', bo_4_subj = '".addslashes($board['bo_4_subj'])."',
bo_5_subj = '{$board['bo_5_subj']}', bo_5_subj = '".addslashes($board['bo_5_subj'])."',
bo_6_subj = '{$board['bo_6_subj']}', bo_6_subj = '".addslashes($board['bo_6_subj'])."',
bo_7_subj = '{$board['bo_7_subj']}', bo_7_subj = '".addslashes($board['bo_7_subj'])."',
bo_8_subj = '{$board['bo_8_subj']}', bo_8_subj = '".addslashes($board['bo_8_subj'])."',
bo_9_subj = '{$board['bo_9_subj']}', bo_9_subj = '".addslashes($board['bo_9_subj'])."',
bo_10_subj = '{$board['bo_10_subj']}', bo_10_subj = '".addslashes($board['bo_10_subj'])."',
bo_1 = '{$board['bo_1']}', bo_1 = '".addslashes($board['bo_1'])."',
bo_2 = '{$board['bo_2']}', bo_2 = '".addslashes($board['bo_2'])."',
bo_3 = '{$board['bo_3']}', bo_3 = '".addslashes($board['bo_3'])."',
bo_4 = '{$board['bo_4']}', bo_4 = '".addslashes($board['bo_4'])."',
bo_5 = '{$board['bo_5']}', bo_5 = '".addslashes($board['bo_5'])."',
bo_6 = '{$board['bo_6']}', bo_6 = '".addslashes($board['bo_6'])."',
bo_7 = '{$board['bo_7']}', bo_7 = '".addslashes($board['bo_7'])."',
bo_8 = '{$board['bo_8']}', bo_8 = '".addslashes($board['bo_8'])."',
bo_9 = '{$board['bo_9']}', bo_9 = '".addslashes($board['bo_9'])."',
bo_10 = '{$board['bo_10']}' "; bo_10 = '".addslashes($board['bo_10'])."' ";
sql_query($sql, false); sql_query($sql, false);
// 게시판 폴더 생성 // 게시판 폴더 생성
+45
View File
@@ -0,0 +1,45 @@
<?php
$sub_menu = "100510";
include_once('./_common.php');
if(!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE))
alert('사용할 수 없는 기능입니다.', G5_ADMIN_URL);
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
$g5['title'] = 'Browscap 업데이트';
include_once('./admin.head.php');
?>
<div id="processing">
<p>Browscap 정보를 업데이트하시려면 아래 업데이트 버튼을 클릭해 주세요.</p>
<button type="button" id="run_update">업데이트</button>
</div>
<script>
$(function() {
$("#run_update").on("click", function() {
$("#processing").html('<div class="update_processing"></div><p>Browscap 정보를 업데이트 중입니다.</p>');
$.ajax({
url: "./browscap_update.php",
async: true,
cache: false,
dataType: "html",
success: function(data) {
if(data != "") {
alert(data);
return false;
}
$("#processing").html("<div class='check_processing'></div><p>Browscap 정보를 업데이트 했습니다.</p>");
}
});
});
});
</script>
<?php
include_once('./admin.tail.php');
?>
+46
View File
@@ -0,0 +1,46 @@
<?php
$sub_menu = "100520";
include_once('./_common.php');
if(!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE))
alert('사용할 수 없는 기능입니다.', G5_ADMIN_URL);
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
$rows = preg_replace('#[^0-9]#', '', $_GET['rows']);
if(!$rows)
$rows = 100;
$g5['title'] = '접속로그 변환';
include_once('./admin.head.php');
?>
<div id="processing">
<p>접속로그 정보를 Browscap 정보로 변환하시려면 아래 업데이트 버튼을 클릭해 주세요.</p>
<button type="button" id="run_update">업데이트</button>
</div>
<script>
$(function() {
$(document).on("click", "#run_update", function() {
$("#processing").html('<div class="update_processing"></div><p>Browscap 정보로 변환 중입니다.</p>');
$.ajax({
method: "GET",
url: "./browscap_converter.php",
data: { rows: "<?php echo $rows; ?>" },
async: true,
cache: false,
dataType: "html",
success: function(data) {
$("#processing").html(data);
}
});
});
});
</script>
<?php
include_once('./admin.tail.php');
?>
+75
View File
@@ -0,0 +1,75 @@
<?php
ini_set('memory_limit', '-1');
include_once('./_common.php');
// clean the output buffer
ob_end_clean();
if(!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE))
die('사용할 수 없는 기능입니다.');
if($is_admin != 'super')
die('최고관리자로 로그인 후 실행해 주세요.');
// browscap cache 파일 체크
if(!is_file(G5_DATA_PATH.'/cache/browscap_cache.php')) {
echo '<p>Browscap 정보가 없습니다. 아래 링크로 이동해 Browscap 정보를 업데이트 하세요.</p>'.PHP_EOL;
echo '<p><a href="'.G5_ADMIN_URL.'/browscap.php">Browscap 업데이트</a></p>'.PHP_EOL;
exit;
}
include_once(G5_PLUGIN_PATH.'/browscap/Browscap.php');
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH.'/cache');
$browscap->doAutoUpdate = false;
$browscap->cacheFilename = 'browscap_cache.php';
// 데이터 변환
$rows = preg_replace('#[^0-9]#', '', $_GET['rows']);
if(!$rows)
$rows = 100;
$sql_common = " from {$g5['visit_table']} where vi_agent <> '' and ( vi_browser = '' or vi_os = '' or vi_device = '' ) ";
$sql_order = " order by vi_id desc ";
$sql_limit = " limit 0, $rows ";
$sql = " select count(vi_id) as cnt $sql_common ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$sql = " select vi_id, vi_agent, vi_browser, vi_os, vi_device
$sql_common
$sql_order
$sql_limit ";
$result = sql_query($sql);
$cnt = 0;
for($i=0; $row=sql_fetch_array($result); $i++) {
$info = $browscap->getBrowser($row['vi_agent']);
$brow = $row['vi_browser'];
if(!$brow)
$brow = $info->Comment;
$os = $row['vi_os'];
if(!$os)
$os = $info->Platform;
$device = $row['vi_device'];
if(!$device)
$device = $info->Device_Type;
$sql2 = " update {$g5['visit_table']}
set vi_browser = '$brow',
vi_os = '$os',
vi_device = '$device'
where vi_id = '{$row['vi_id']}' ";
sql_query($sql2);
$cnt++;
}
if(($total_count - $cnt) == 0 || $total_count == 0)
echo '<div class="check_processing"></div><p>변환완료</p>';
else
echo '<p>총 '.number_format($total_count).'건 중 '.number_format($cnt).'건 변환완료<br><br>접속로그를 추가로 변환하시려면 아래 업데이트 버튼을 클릭해 주세요.</p><button type="button" id="run_update">업데이트</button>';
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
ini_set('memory_limit', '-1');
$sub_menu = "100510";
include_once('./_common.php');
// clean the output buffer
ob_end_clean();
if(!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE))
die('사용할 수 없는 기능입니다.');
if ($is_admin != 'super')
die('최고관리자만 접근 가능합니다.');
include_once(G5_PLUGIN_PATH.'/browscap/Browscap.php');
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH.'/cache');
$browscap->updateMethod = 'cURL';
$browscap->cacheFilename = 'browscap_cache.php';
$browscap->updateCache();
die('');
?>
+8
View File
@@ -186,6 +186,14 @@ if(!isset($config['cf_sms_type'])) {
ADD `cf_sms_type` varchar(10) NOT NULL DEFAULT '' AFTER `cf_sms_use` ", true); ADD `cf_sms_type` varchar(10) NOT NULL DEFAULT '' AFTER `cf_sms_use` ", true);
} }
// 접속자 정보 필드 추가
if(!sql_query(" select vi_browser from {$g5['visit_table']} limit 1 ")) {
sql_query(" ALTER TABLE `{$g5['visit_table']}`
ADD `vi_browser` varchar(255) NOT NULL DEFAULT '' AFTER `vi_agent`,
ADD `vi_os` varchar(255) NOT NULL DEFAULT '' AFTER `vi_browser`,
ADD `vi_device` varchar(255) NOT NULL DEFAULT '' AFTER `vi_os` ", true);
}
if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic"; if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic";
if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic"; if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic";
+1 -1
View File
@@ -69,7 +69,7 @@ $result = sql_query($sql);
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php for ($i=0; $row=mysql_fetch_array($result); $i++) { <?php for ($i=0; $row=sql_fetch_array($result); $i++) {
$bg = 'bg'.($i%2); $bg = 'bg'.($i%2);
?> ?>
<tr class="<?php echo $bg; ?>"> <tr class="<?php echo $bg; ?>">
+12 -2
View File
@@ -395,6 +395,9 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
.td_tdiv {border-bottom:1px solid #c9c9c9 !important} .td_tdiv {border-bottom:1px solid #c9c9c9 !important}
.td_tel {width:80px;text-align:center} .td_tel {width:80px;text-align:center}
.td_test {width:50px;text-align:center} .td_test {width:50px;text-align:center}
.td_category1{width:130px;text-align:center}
.td_category2{width:100px;text-align:center}
.td_category3{width:80px;text-align:center}
.txt_true {color:#e8180c} .txt_true {color:#e8180c}
.txt_false {color:#ccc} .txt_false {color:#ccc}
@@ -730,7 +733,7 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
#theme_list li .tmli_if:hover button.tmli_dt{display:block} #theme_list li .tmli_if:hover button.tmli_dt{display:block}
#theme_list li .theme_sl{float:left;border:none;margin-top:5px;padding:0 5px;height:26px;background:#999;color:#fff} #theme_list li .theme_sl{float:left;border:none;margin-top:5px;padding:0 5px;height:26px;background:#999;color:#fff}
#theme_list li .theme_sl:hover{background:#ff3061} #theme_list li .theme_sl:hover{background:#ff3061}
#theme_list li .theme_deactive{margin-left:4px} #theme_list li .theme_deactive{margin-left:4px}
#theme_list li .theme_sl_use{background:#ff3061;line-height:26px} #theme_list li .theme_sl_use{background:#ff3061;line-height:26px}
#theme_list li .theme_pr{float:right;margin-top:5px;padding:0 5px;height:24px;line-height:24px; border: 1px solid #ccc; background: #fafafa; } #theme_list li .theme_pr{float:right;margin-top:5px;padding:0 5px;height:24px;line-height:24px; border: 1px solid #ccc; background: #fafafa; }
#theme_list li .theme_preview{ float: right; margin-top: 5px; padding:0 5px;height:26px; border: 1px solid #ccc; background: #fafafa; margin-right:3px} #theme_list li .theme_preview{ float: right; margin-top: 5px; padding:0 5px;height:26px; border: 1px solid #ccc; background: #fafafa; margin-right:3px}
@@ -763,4 +766,11 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
/*전송실패 문자 재전송 내역*/ /*전송실패 문자 재전송 내역*/
.sms_table{padding:0 20px 40px;} .sms_table{padding:0 20px 40px;}
.sms_table table th{border:1px solid #ddd;padding:9px 0} .sms_table table th{border:1px solid #ddd;padding:9px 0}
.sms_table table td{border:1px solid #ddd;text-align:center;width:16%;padding:9px 0} .sms_table table td{border:1px solid #ddd;text-align:center;width:16%;padding:9px 0}
/* Browscap */
.update_processing{width:300px;height:300px;margin:0 auto;background:url(../img/ajax_loader.gif) no-repeat 0 0}
#processing{margin: 0 auto;padding: 70px 0;max-width: 800px;border: 1px solid #eee;background: #f9f9f9;text-align:center;}
#processing p{font-size:1.2em}
.check_processing {width:300px;height:300px;margin:0 auto;background:url(../img/check.png) no-repeat 50% 50% }
#processing button{background:#ff3061;border:none;color:#fff;padding: 15px;width:150px;margin-top:15px}
+1 -1
View File
@@ -21,7 +21,7 @@ if ($w == "")
$sql_common "; $sql_common ";
sql_query($sql); sql_query($sql);
$fa_id = mysql_insert_id(); $fa_id = sql_insert_id();
} }
else if ($w == "u") else if ($w == "u")
{ {
+1 -1
View File
@@ -31,7 +31,7 @@ if ($w == "")
$sql = " insert {$g5['faq_master_table']} $sql_common "; $sql = " insert {$g5['faq_master_table']} $sql_common ";
sql_query($sql); sql_query($sql);
$fm_id = mysql_insert_id(); $fm_id = sql_insert_id();
} }
else if ($w == "u") else if ($w == "u")
{ {
+1 -1
View File
@@ -93,7 +93,7 @@ $result = sql_query($sql);
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php for ($i=0; $row=mysql_fetch_array($result); $i++) { <?php for ($i=0; $row=sql_fetch_array($result); $i++) {
$sql1 = " select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' "; $sql1 = " select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' ";
$row1 = sql_fetch($sql1); $row1 = sql_fetch($sql1);
$cnt = $row1['cnt']; $cnt = $row1['cnt'];
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

+1 -1
View File
@@ -51,7 +51,7 @@ $colspan = 7;
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=mysql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$s_vie = '<a href="./mail_preview.php?ma_id='.$row['ma_id'].'" target="_blank">미리보기</a>'; $s_vie = '<a href="./mail_preview.php?ma_id='.$row['ma_id'].'" target="_blank">미리보기</a>';
$num = number_format($total_count - ($page - 1) * $config['cf_page_rows'] - $i); $num = number_format($total_count - ($page - 1) * $config['cf_page_rows'] - $i);
+1 -1
View File
@@ -27,7 +27,7 @@ if($w == "")
$sql = " insert {$g5['new_win_table']} set $sql_common "; $sql = " insert {$g5['new_win_table']} set $sql_common ";
sql_query($sql); sql_query($sql);
$nw_id = mysql_insert_id(); $nw_id = sql_insert_id();
} }
else if ($w == "u") else if ($w == "u")
{ {
+1 -1
View File
@@ -70,7 +70,7 @@ $result = sql_query($sql);
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=mysql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$bg = 'bg'.($i%2); $bg = 'bg'.($i%2);
switch($row['nw_device']) { switch($row['nw_device']) {
+1 -1
View File
@@ -17,7 +17,7 @@ if ($w == '')
values ( '{$_POST['po_subject']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_etc']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '".G5_TIME_YMD."' ) "; values ( '{$_POST['po_subject']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_etc']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '".G5_TIME_YMD."' ) ";
sql_query($sql); sql_query($sql);
$po_id = mysql_insert_id(); $po_id = sql_insert_id();
} }
else if ($w == 'u') else if ($w == 'u')
{ {
+1 -1
View File
@@ -16,7 +16,7 @@ $sql_order = " order by cnt desc ";
$sql = " select pp_word {$sql_common} {$sql_search} {$sql_group} "; $sql = " select pp_word {$sql_common} {$sql_search} {$sql_group} ";
$result = sql_query($sql); $result = sql_query($sql);
$total_count = mysql_num_rows($result); $total_count = sql_num_rows($result);
$rows = $config['cf_page_rows']; $rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
+1 -1
View File
@@ -5,7 +5,7 @@ include_once(G5_ADMIN_PATH.'/admin.lib.php');
include_once(G5_SMS5_PATH.'/sms5.lib.php'); include_once(G5_SMS5_PATH.'/sms5.lib.php');
if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) { if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) {
if(!mysql_num_rows(mysql_query(" show tables like '{$g5['sms5_config_table']}' "))) if(!sql_num_rows(sql_query(" show tables like '{$g5['sms5_config_table']}' ")))
goto_url('install.php'); goto_url('install.php');
// SMS 설정값 배열변수 // SMS 설정값 배열변수
+1 -40
View File
@@ -90,49 +90,10 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
<tr> <tr>
<th scope="row"><label for="cf_phone">회신번호<strong class="sound_only"> 필수</strong></label></th> <th scope="row"><label for="cf_phone">회신번호<strong class="sound_only"> 필수</strong></label></th>
<td> <td>
<?php echo help("회신받을 휴대폰 번호를 입력하세요. '-' 를 꼭 입력하세요.<br>예) 010-123-4567"); ?> <?php echo help("회신받을 휴대폰 번호를 입력하세요. 회신번호는 발신번호로 사전등록된 번호와 동일해야 합니다.<br>예) 010-123-4567"); ?>
<input type="text" name="cf_phone" value="<?php echo $sms5['cf_phone']; ?>" id="cf_phone" required class="frm_input required" size="12"> <input type="text" name="cf_phone" value="<?php echo $sms5['cf_phone']; ?>" id="cf_phone" required class="frm_input required" size="12">
</td> </td>
</tr> </tr>
<tr>
<th scope="row"><label for="cf_member">회원간 문자전송</label></th>
<td>
<?php echo help("허용에 체크하면 회원끼리 문자전송이 가능합니다.");?>
<input type="checkbox" name="cf_member" value="1" id="cf_member" <?php echo get_checked(1, $sms5['cf_member']); ?>> <label for="cf_member">허용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_level">문자전송가능 레벨</label></th>
<td>
<?php echo help("문자전송을 허용할 회원레벨을 선택해주세요.");?>
<select name="cf_level" id="cf_level">
<?php for ($i=1; $i<=10; $i++) { ?>
<option value="<?php echo $i?>"<?php echo get_selected($i, $sms5['cf_level']);?>> <?php echo $i?> </option>
<?php } ?>
</select>
레벨 이상
</td>
</tr>
<tr>
<th scope="row"><label for="cf_point">문자전송 차감 포인트<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회원이 문자를 전송할시에 차감할 포인트를 입력해주세요. 0이면 포인트를 차감하지 않습니다.");?>
<input type="text" name="cf_point" value="<?php echo $sms5['cf_point']; ?>" id="cf_point" required class="frm_input required" size="5">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_day_count">문자전송 하루제한 갯수<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회원이 하루에 보낼수 있는 문자 갯수를 입력해주세요. 0이면 제한하지 않습니다.");?>
<input type="text" name="cf_day_count" value="<?php echo $sms5['cf_day_count']; ?>" id="cf_day_count" required class="frm_input required" size="5">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo get_sms5_skin_select('skin', 'cf_skin', 'cf_skin', $sms5['cf_skin'], 'required'); ?>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
+5 -6
View File
@@ -8,16 +8,15 @@ check_demo();
$g5['title'] = "SMS 기본설정"; $g5['title'] = "SMS 기본설정";
// 회신번호 체크
if(!check_vaild_callback($cf_phone))
alert('회신번호가 올바르지 않습니다.');
$userinfo = get_icode_userinfo($cf_icode_id, $cf_icode_pw); $userinfo = get_icode_userinfo($cf_icode_id, $cf_icode_pw);
if ($userinfo['code'] == '202') if ($userinfo['code'] == '202')
alert('아이코드 아이디와 패스워드가 맞지 않습니다.'); alert('아이코드 아이디와 패스워드가 맞지 않습니다.');
if ($cf_member == '1')
$cf_member = 1;
else
$cf_member = 0;
$res = sql_fetch("select * from ".$g5['sms5_config_table']." limit 1"); $res = sql_fetch("select * from ".$g5['sms5_config_table']." limit 1");
if (!$res) if (!$res)
@@ -25,7 +24,7 @@ if (!$res)
else else
$sql = "update "; $sql = "update ";
$sql .= $g5['sms5_config_table']." set cf_phone='$cf_phone', cf_member='$cf_member', cf_level='$cf_level', cf_point='$cf_point', cf_day_count='$cf_day_count', cf_skin = '$cf_skin' "; $sql .= $g5['sms5_config_table']." set cf_phone='$cf_phone' ";
sql_query($sql); sql_query($sql);
-90
View File
@@ -1,90 +0,0 @@
<?php
$sub_menu = "900410";
include_once("./_common.php");
$page_size = 20;
$colspan = 7;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자전송 내역 (회원)";
if ($page < 1) $page = 1;
if ($st && trim($sv))
$sql_search = " and $st like '%$sv%' ";
else
$sql_search = "";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_member_history_table']} where 1 $sql_search");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="search_form" method="get" action="<?php echo $_SEVER['SCRIPT_NAME']?>" class="local_sch01 local_sch">
<label for="st" class="sound_only">검색대상</label>
<select name="st" id="st">
<option value="mb_id"<?php echo get_selected('mh_name', $st); ?>>아이디</option>
<option value="mh_hp"<?php echo get_selected('mh_hp', $st); ?>>받는번호</option>
<option value="mh_reply"<?php echo get_selected('mh_reply', $st); ?>>보내는번호</option>
</select>
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv ?>" id="sv" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">회원</th>
<th scope="col">보내는번호</th>
<th scope="col">받는번호</th>
<th scope="col">전송일시</th>
<th scope="col">예약</th>
<th scope="col">Log</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan?>" class="empty_table" >
데이터가 없습니다.
</td>
</tr>
<?php
}
$qry = sql_query("select * from {$g5['sms5_member_history_table']} where 1 $sql_search order by mh_no desc limit $page_start, $page_size");
while($row = sql_fetch_array($qry)) {
$bg = 'bg'.($line++%2);
$mb = get_member($row['mb_id']);
$mb_id = get_sideview($row['mb_id'], $mb['mb_nick']);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $vnum--?></td>
<td class="td_mbid"><?php echo $mb_id?></td>
<td class="td_numbig"><?php echo $row['mh_reply']?></td>
<td class="td_numbig"><?php echo $row['mh_hp']?></td>
<td class="td_datetime"><?php echo $row['mh_datetime']?></td>
<td class="td_boolean"><?php echo $row['mh_booking']!='0000-00-00 00:00:00'?"<span title='{$row['mh_booking']}'>예약</span>":'';?></td>
<td><?php echo $row['mh_log']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME']."?st=$st&amp;sv=$sv&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>
+2 -2
View File
@@ -53,7 +53,7 @@ eval("\$file = \"$file\";");
$f = explode(";", $file); $f = explode(";", $file);
for ($i=0; $i<count($f); $i++) { for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == "") continue; if (trim($f[$i]) == "") continue;
mysql_query($f[$i]) or die(mysql_error()); sql_query($f[$i]) or die(mysqli_error());
} }
// 테이블 생성 ------------------------------------ // 테이블 생성 ------------------------------------
@@ -68,7 +68,7 @@ $download_point = -20;
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// config 테이블 설정 // config 테이블 설정
$sql = " insert into {$g5['sms5_book_group_table']} set bg_name='미분류'"; $sql = " insert into {$g5['sms5_book_group_table']} set bg_name='미분류'";
mysql_query($sql) or die(mysql_error() . "<p>" . $sql); sql_query($sql) or die(mysqli_error() . "<p>" . $sql);
echo "<script>document.getElementById('sms5_job_02').innerHTML='DB설정 완료';</script>"; echo "<script>document.getElementById('sms5_job_02').innerHTML='DB설정 완료';</script>";
flush(); usleep(50000); flush(); usleep(50000);
+1 -28
View File
@@ -65,12 +65,7 @@ DROP TABLE IF EXISTS `{$g5['sms5_config_table']}`;
CREATE TABLE `{$g5['sms5_config_table']}` ( CREATE TABLE `{$g5['sms5_config_table']}` (
`cf_phone` varchar(255) NOT NULL default '', `cf_phone` varchar(255) NOT NULL default '',
`cf_datetime` datetime NOT NULL default '0000-00-00 00:00:00', `cf_datetime` datetime NOT NULL default '0000-00-00 00:00:00'
`cf_member` tinyint(4) NOT NULL default '1',
`cf_level` tinyint(4) NOT NULL default '2',
`cf_point` int(11) NOT NULL default '0',
`cf_day_count` int(11) NOT NULL default '0',
`cf_skin` varchar(100) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -164,25 +159,3 @@ CREATE TABLE `{$g5['sms5_write_table']}` (
`wr_memo` text NOT NULL, `wr_memo` text NOT NULL,
KEY `wr_no` (`wr_no`,`wr_renum`) KEY `wr_no` (`wr_no`,`wr_renum`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_member_history_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_member_history_table']}`;
CREATE TABLE `{$g5['sms5_member_history_table']}` (
`mh_no` int(11) NOT NULL auto_increment,
`mb_id` varchar(30) NOT NULL,
`mh_reply` varchar(30) NOT NULL,
`mh_hp` varchar(30) NOT NULL,
`mh_datetime` datetime NOT NULL,
`mh_booking` datetime NOT NULL,
`mh_log` varchar(255) NOT NULL,
`mh_ip` varchar(15) NOT NULL,
PRIMARY KEY (`mh_no`),
KEY `mb_id` (`mb_id`,`mh_datetime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+3 -3
View File
@@ -114,7 +114,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
<div id="write_reply"> <div id="write_reply">
<label for="wr_reply">회신<strong class="sound_only"> 필수</strong></label> <label for="wr_reply">회신<strong class="sound_only"> 필수</strong></label>
<input type="text" name="wr_reply" value="<?php echo $sms5['cf_phone']?>" id="wr_reply" required class="frm_input required" size="17" maxlength="20"> <input type="text" name="wr_reply" value="<?php echo $sms5['cf_phone']?>" id="wr_reply" required class="frm_input required" size="17" maxlength="20" readonly="readonly">
</div> </div>
<div id="write_recv" class="write_inner"> <div id="write_recv" class="write_inner">
@@ -532,7 +532,7 @@ if ($wr_no)
// 회원목록 // 회원목록
$sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no > 0 "; $sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no > 0 ";
$qry = sql_query($sql); $qry = sql_query($sql);
$tot = mysql_num_rows($qry); $tot = sql_num_rows($qry);
if ($tot > 0) { if ($tot > 0) {
@@ -550,7 +550,7 @@ if ($wr_no)
// 비회원 목록 // 비회원 목록
$sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no = 0 "; $sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no = 0 ";
$qry = sql_query($sql); $qry = sql_query($sql);
$tot = mysql_num_rows($qry); $tot = sql_num_rows($qry);
if ($tot > 0) if ($tot > 0)
{ {
+13 -1
View File
@@ -12,6 +12,9 @@ $wr_message = clean_xss_tags(trim($wr_message));
if (!$wr_reply) if (!$wr_reply)
win_close_alert('회신 번호를 숫자, - 로 입력해주세요.'); win_close_alert('회신 번호를 숫자, - 로 입력해주세요.');
if(!check_vaild_callback($wr_reply))
win_close_alert('회신 번호를 올바르게 입력해 주십시오.');
if (!$wr_message) if (!$wr_message)
win_close_alert('메세지를 입력해주세요.'); win_close_alert('메세지를 입력해주세요.');
@@ -42,6 +45,9 @@ while ($row = array_shift($send_list))
while ($row = sql_fetch_array($qry)) while ($row = sql_fetch_array($qry))
{ {
$row['bk_hp'] = get_hp($row['bk_hp'], 0); $row['bk_hp'] = get_hp($row['bk_hp'], 0);
if(!$row['bk_hp']) continue;
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) { if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++; $overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] ); array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -63,6 +69,8 @@ while ($row = array_shift($send_list))
$hp = get_hp($row['mb_hp'], 0); $hp = get_hp($row['mb_hp'], 0);
$mb_id = $row['mb_id']; $mb_id = $row['mb_id'];
if(!$hp) continue;
if ($wr_overlap && array_overlap($hps, $hp)) { if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++; $overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] ); array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -84,6 +92,8 @@ while ($row = array_shift($send_list))
$hp = get_hp($item[$i][1], 0); $hp = get_hp($item[$i][1], 0);
$name = $item[$i][0]; $name = $item[$i][0];
if(!$hp) continue;
if ($wr_overlap && array_overlap($hps, $hp)) { if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++; $overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] ); array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -99,6 +109,8 @@ while ($row = array_shift($send_list))
$row = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$item[$i]'"); $row = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$item[$i]'");
$row['bk_hp'] = get_hp($row['bk_hp'], 0); $row['bk_hp'] = get_hp($row['bk_hp'], 0);
if(!$row['bk_hp']) continue;
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) { if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++; $overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] ); array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -232,7 +244,7 @@ if($config['cf_sms_type'] == 'LMS') {
} }
} else { } else {
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']); $SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$result = $SMS->Add($list, $reply, '', '', $wr_message, $booking, $wr_total); $result = $SMS->Add2($list, $reply, '', '', $wr_message, $booking, $wr_total);
if ($result) if ($result)
{ {
+3
View File
@@ -29,6 +29,9 @@ $query_string = $qstr ? '?'.$qstr : '';
<li><a href="./visit_domain.php<?php echo $query_string ?>">도메인</a></li> <li><a href="./visit_domain.php<?php echo $query_string ?>">도메인</a></li>
<li><a href="./visit_browser.php<?php echo $query_string ?>">브라우저</a></li> <li><a href="./visit_browser.php<?php echo $query_string ?>">브라우저</a></li>
<li><a href="./visit_os.php<?php echo $query_string ?>">운영체제</a></li> <li><a href="./visit_os.php<?php echo $query_string ?>">운영체제</a></li>
<?php if(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE) { ?>
<li><a href="./visit_device.php<?php echo $query_string ?>">접속기기</a></li>
<?php } ?>
<li><a href="./visit_hour.php<?php echo $query_string ?>">시간</a></li> <li><a href="./visit_hour.php<?php echo $query_string ?>">시간</a></li>
<li><a href="./visit_week.php<?php echo $query_string ?>">요일</a></li> <li><a href="./visit_week.php<?php echo $query_string ?>">요일</a></li>
<li><a href="./visit_date.php<?php echo $query_string ?>">일</a></li> <li><a href="./visit_date.php<?php echo $query_string ?>">일</a></li>
+4 -2
View File
@@ -15,7 +15,9 @@ $sql = " select * from {$g5['visit_table']}
where vi_date between '{$fr_date}' and '{$to_date}' "; where vi_date between '{$fr_date}' and '{$to_date}' ";
$result = sql_query($sql); $result = sql_query($sql);
while ($row=sql_fetch_array($result)) { while ($row=sql_fetch_array($result)) {
$s = get_brow($row['vi_agent']); $s = $row['vi_browser'];
if(!$s)
$s = get_brow($row['vi_agent']);
$arr[$s]++; $arr[$s]++;
@@ -70,7 +72,7 @@ while ($row=sql_fetch_array($result)) {
<tr class="<?php echo $bg; ?>"> <tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $no ?></td> <td class="td_num"><?php echo $no ?></td>
<td class="td_category"><?php echo $key ?></td> <td class="td_category td_category1"><?php echo $key ?></td>
<td> <td>
<div class="visit_bar"> <div class="visit_bar">
<span style="width:<?php echo $s_rate ?>%"></span> <span style="width:<?php echo $s_rate ?>%"></span>
+101
View File
@@ -0,0 +1,101 @@
<?php
$sub_menu = "200800";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
$g5['title'] = '기기별 접속자집계';
include_once('./visit.sub.php');
$colspan = 5;
$max = 0;
$sum_count = 0;
$sql = " select * from {$g5['visit_table']}
where vi_date between '$fr_date' and '$to_date' ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
$s = $row['vi_device'];
if(!$s)
$s = '기타';
$arr[$s]++;
if ($arr[$s] > $max) $max = $arr[$s];
$sum_count++;
}
?>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">순위</th>
<th scope="col">접속기기</th>
<th scope="col">그래프</th>
<th scope="col">접속자수</th>
<th scope="col">비율(%)</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">합계</td>
<td><strong><?php echo $sum_count ?></strong></td>
<td>100%</td>
</tr>
</tfoot>
<tbody>
<?php
$i = 0;
$k = 0;
$save_count = -1;
$tot_count = 0;
if (count($arr)) {
arsort($arr);
foreach ($arr as $key=>$value) {
$count = $arr[$key];
if ($save_count != $count) {
$i++;
$no = $i;
$save_count = $count;
} else {
$no = '';
}
if (!$key) {
$key = '기타';
}
$rate = ($count / $sum_count * 100);
$s_rate = number_format($rate, 1);
$bg = 'bg'.($i%2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $no ?></td>
<td class="td_category td_category1"><?php echo $key ?></td>
<td>
<div class="visit_bar">
<span style="width:<?php echo $s_rate ?>%"></span>
</div>
</td>
<td class="td_numbig"><?php echo $count ?></td>
<td class="td_num"><?php echo $s_rate ?></td>
</tr>
<?php
}
} else {
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<?php
include_once('./admin.tail.php');
?>
+15 -6
View File
@@ -7,7 +7,7 @@ auth_check($auth[$sub_menu], 'r');
$g5['title'] = '접속자집계'; $g5['title'] = '접속자집계';
include_once('./visit.sub.php'); include_once('./visit.sub.php');
$colspan = 5; $colspan = 6;
$sql_common = " from {$g5['visit_table']} "; $sql_common = " from {$g5['visit_table']} ";
$sql_search = " where vi_date between '{$fr_date}' and '{$to_date}' "; $sql_search = " where vi_date between '{$fr_date}' and '{$to_date}' ";
@@ -41,15 +41,23 @@ $result = sql_query($sql);
<th scope="col">IP</th> <th scope="col">IP</th>
<th scope="col">접속 경로</th> <th scope="col">접속 경로</th>
<th scope="col">브라우저</th> <th scope="col">브라우저</th>
<th scope="col">운영체제</th> <th scope="col">OS</th>
<th scope="col">접속기기</th>
<th scope="col">일시</th> <th scope="col">일시</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$brow = get_brow($row['vi_agent']); $brow = $row['vi_browser'];
$os = get_os($row['vi_agent']); if(!$brow)
$brow = get_brow($row['vi_agent']);
$os = $row['vi_os'];
if(!$os)
$os = get_os($row['vi_agent']);
$device = $row['vi_device'];
$link = ''; $link = '';
$link2 = ''; $link2 = '';
@@ -83,8 +91,9 @@ $result = sql_query($sql);
<tr class="<?php echo $bg; ?>"> <tr class="<?php echo $bg; ?>">
<td class="td_category"><?php echo $ip ?></td> <td class="td_category"><?php echo $ip ?></td>
<td><?php echo $link ?><?php echo $title ?><?php echo $link2 ?></td> <td><?php echo $link ?><?php echo $title ?><?php echo $link2 ?></td>
<td class="td_category"><?php echo $brow ?></td> <td class="td_category td_category1"><?php echo $brow ?></td>
<td class="td_category"><?php echo $os ?></td> <td class="td_category td_category3"><?php echo $os ?></td>
<td class="td_category td_category2"><?php echo $device; ?></td>
<td class="td_datetime"><?php echo $row['vi_date'] ?> <?php echo $row['vi_time'] ?></td> <td class="td_datetime"><?php echo $row['vi_date'] ?> <?php echo $row['vi_time'] ?></td>
</tr> </tr>
+4 -2
View File
@@ -15,7 +15,9 @@ $sql = " select * from {$g5['visit_table']}
where vi_date between '$fr_date' and '$to_date' "; where vi_date between '$fr_date' and '$to_date' ";
$result = sql_query($sql); $result = sql_query($sql);
while ($row=sql_fetch_array($result)) { while ($row=sql_fetch_array($result)) {
$s = get_os($row['vi_agent']); $s = $row['vi_os'];
if(!$s)
$s = get_os($row['vi_agent']);
$arr[$s]++; $arr[$s]++;
@@ -63,7 +65,7 @@ while ($row=sql_fetch_array($result)) {
} }
if (!$key) { if (!$key) {
$key = '직접'; $key = 'Unknown';
} }
$rate = ($count / $sum_count * 100); $rate = ($count / $sum_count * 100);
+14 -8
View File
@@ -9,7 +9,7 @@ $g5['title'] = '접속자검색';
include_once('./admin.head.php'); include_once('./admin.head.php');
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php'); include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
$colspan = 5; $colspan = 6;
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'">처음</a>'; //페이지 처음으로 (초기화용도) $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'">처음</a>'; //페이지 처음으로 (초기화용도)
?> ?>
@@ -36,6 +36,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'">처음</a>'; //페이지 처
<th scope="col">접속 경로</th> <th scope="col">접속 경로</th>
<th scope="col">브라우저</th> <th scope="col">브라우저</th>
<th scope="col">OS</th> <th scope="col">OS</th>
<th scope="col">접속기기</th>
<th scope="col">일시</th> <th scope="col">일시</th>
</tr> </tr>
</thead> </thead>
@@ -68,8 +69,15 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'">처음</a>'; //페이지 처
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
$brow = get_brow($row['vi_agent']); $brow = $row['vi_browser'];
$os = get_os($row['vi_agent']); if(!$brow)
$brow = get_brow($row['vi_agent']);
$os = $row['vi_os'];
if(!$os)
$os = get_os($row['vi_agent']);
$device = $row['vi_device'];
$link = ""; $link = "";
$referer = ""; $referer = "";
@@ -92,16 +100,14 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'">처음</a>'; //페이지 처
else else
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['vi_ip']); $ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['vi_ip']);
if ($brow == '기타') $brow = '<span title="'.get_text($row['vi_agent']).'">'.$brow.'</span>';
if ($os == '기타') $os = '<span title="'.get_text($row['vi_agent']).'">'.$os.'</span>';
$bg = 'bg'.($i%2); $bg = 'bg'.($i%2);
?> ?>
<tr class="<?php echo $bg; ?>"> <tr class="<?php echo $bg; ?>">
<td class="td_id"><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?sfl=vi_ip&amp;stx=<?php echo $ip; ?>"><?php echo $ip; ?></a></td> <td class="td_id"><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?sfl=vi_ip&amp;stx=<?php echo $ip; ?>"><?php echo $ip; ?></a></td>
<td><?php echo $link.$title; ?></a></td> <td><?php echo $link.$title; ?></a></td>
<td class="td_idsmall"><?php echo $brow; ?></td> <td class="td_idsmall td_category1"><?php echo $brow; ?></td>
<td class="td_idsmall"><?php echo $os; ?></td> <td class="td_idsmall td_category3"><?php echo $os; ?></td>
<td class="td_idsmall td_category2"><?php echo $device; ?></td>
<td class="td_datetime"><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?sfl=vi_date&amp;stx=<?php echo $row['vi_date']; ?>"><?php echo $row['vi_date']; ?></a> <?php echo $row['vi_time']; ?></td> <td class="td_datetime"><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?sfl=vi_date&amp;stx=<?php echo $row['vi_date']; ?>"><?php echo $row['vi_date']; ?></a> <?php echo $row['vi_time']; ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
+4
View File
@@ -5,8 +5,12 @@ include_once(G5_LIB_PATH.'/register.lib.php');
$mb_email = trim($_POST['reg_mb_email']); $mb_email = trim($_POST['reg_mb_email']);
$mb_id = trim($_POST['reg_mb_id']); $mb_id = trim($_POST['reg_mb_id']);
set_session('ss_check_mb_email', '');
if ($msg = empty_mb_email($mb_email)) die($msg); if ($msg = empty_mb_email($mb_email)) die($msg);
if ($msg = valid_mb_email($mb_email)) die($msg); if ($msg = valid_mb_email($mb_email)) die($msg);
if ($msg = prohibit_mb_email($mb_email)) die($msg); if ($msg = prohibit_mb_email($mb_email)) die($msg);
if ($msg = exist_mb_email($mb_email, $mb_id)) die($msg); if ($msg = exist_mb_email($mb_email, $mb_id)) die($msg);
set_session('ss_check_mb_email', $mb_email);
?> ?>
+4
View File
@@ -4,9 +4,13 @@ include_once(G5_LIB_PATH.'/register.lib.php');
$mb_id = trim($_POST['reg_mb_id']); $mb_id = trim($_POST['reg_mb_id']);
set_session('ss_check_mb_id', '');
if ($msg = empty_mb_id($mb_id)) die($msg); if ($msg = empty_mb_id($mb_id)) die($msg);
if ($msg = valid_mb_id($mb_id)) die($msg); if ($msg = valid_mb_id($mb_id)) die($msg);
if ($msg = count_mb_id($mb_id)) die($msg); if ($msg = count_mb_id($mb_id)) die($msg);
if ($msg = exist_mb_id($mb_id)) die($msg); if ($msg = exist_mb_id($mb_id)) die($msg);
if ($msg = reserve_mb_id($mb_id)) die($msg); if ($msg = reserve_mb_id($mb_id)) die($msg);
set_session('ss_check_mb_id', $mb_id);
?> ?>
+4
View File
@@ -5,9 +5,13 @@ include_once(G5_LIB_PATH.'/register.lib.php');
$mb_nick = trim($_POST['reg_mb_nick']); $mb_nick = trim($_POST['reg_mb_nick']);
$mb_id = trim($_POST['reg_mb_id']); $mb_id = trim($_POST['reg_mb_id']);
set_session('ss_check_mb_nick', '');
if ($msg = empty_mb_nick($mb_nick)) die($msg); if ($msg = empty_mb_nick($mb_nick)) die($msg);
if ($msg = valid_mb_nick($mb_nick)) die($msg); if ($msg = valid_mb_nick($mb_nick)) die($msg);
if ($msg = count_mb_nick($mb_nick)) die($msg); if ($msg = count_mb_nick($mb_nick)) die($msg);
if ($msg = exist_mb_nick($mb_nick, $mb_id)) die($msg); if ($msg = exist_mb_nick($mb_nick, $mb_id)) die($msg);
if ($msg = reserve_mb_nick($mb_nick)) die($msg); if ($msg = reserve_mb_nick($mb_nick)) die($msg);
set_session('ss_check_mb_nick', $mb_nick);
?> ?>
+1 -1
View File
@@ -53,7 +53,7 @@ if ($sca || $stx) {
/* /*
$sql = " select distinct wr_parent from {$write_table} where {$sql_search} "; $sql = " select distinct wr_parent from {$write_table} where {$sql_search} ";
$result = sql_query($sql); $result = sql_query($sql);
$total_count = mysql_num_rows($result); $total_count = sql_num_rows($result);
*/ */
} else { } else {
$sql_search = ""; $sql_search = "";
+1 -1
View File
@@ -99,7 +99,7 @@ while ($row = sql_fetch_array($result))
wr_10 = '".addslashes($row2['wr_10'])."' "; wr_10 = '".addslashes($row2['wr_10'])."' ";
sql_query($sql); sql_query($sql);
$insert_id = mysql_insert_id(); $insert_id = sql_insert_id();
// 코멘트가 아니라면 // 코멘트가 아니라면
if (!$row2['wr_is_comment']) if (!$row2['wr_is_comment'])
+2 -2
View File
@@ -187,7 +187,7 @@ for ($i=1; $i<=count($_FILES['bf_file']['name']); $i++) {
$shuffle = implode('', $chars_array); $shuffle = implode('', $chars_array);
// 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925) // 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925)
$upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.str_replace('%', '', urlencode(str_replace(' ', '_', $filename))); $upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.replace_filename($filename);
$dest_file = G5_DATA_PATH.'/qa/'.$upload[$i]['file']; $dest_file = G5_DATA_PATH.'/qa/'.$upload[$i]['file'];
@@ -244,7 +244,7 @@ if($w == '' || $w == 'a' || $w == 'r') {
sql_query($sql); sql_query($sql);
if($w == '' || $w == 'r') { if($w == '' || $w == 'r') {
$qa_id = mysql_insert_id(); $qa_id = sql_insert_id();
if($w == 'r' && $write['qa_related']) { if($w == 'r' && $write['qa_related']) {
$qa_related = $write['qa_related']; $qa_related = $write['qa_related'];
+30 -11
View File
@@ -62,12 +62,34 @@ $mb_8 = isset($_POST['mb_8']) ? trim($_POST['mb_8'])
$mb_9 = isset($_POST['mb_9']) ? trim($_POST['mb_9']) : ""; $mb_9 = isset($_POST['mb_9']) ? trim($_POST['mb_9']) : "";
$mb_10 = isset($_POST['mb_10']) ? trim($_POST['mb_10']) : ""; $mb_10 = isset($_POST['mb_10']) ? trim($_POST['mb_10']) : "";
$mb_name = clean_xss_tags($mb_name);
$mb_email = get_email_address($mb_email);
$mb_homepage = clean_xss_tags($mb_homepage);
$mb_tel = clean_xss_tags($mb_tel);
$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_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
if ($w == '' || $w == 'u') { if ($w == '' || $w == 'u') {
if ($msg = empty_mb_id($mb_id)) alert($msg, "", true, true); // alert($msg, $url, $error, $post); if ($msg = empty_mb_id($mb_id)) alert($msg, "", true, true); // alert($msg, $url, $error, $post);
if ($msg = valid_mb_id($mb_id)) alert($msg, "", true, true); if ($msg = valid_mb_id($mb_id)) alert($msg, "", true, true);
if ($msg = count_mb_id($mb_id)) alert($msg, "", true, true); if ($msg = count_mb_id($mb_id)) alert($msg, "", true, true);
// 이름, 닉네임에 utf-8 이외의 문자가 포함됐다면 오류
// 서버환경에 따라 정상적으로 체크되지 않을 수 있음.
$tmp_mb_name = iconv('UTF-8', 'UTF-8//IGNORE', $mb_name);
if($tmp_mb_name != $mb_name) {
alert('이름을 올바르게 입력해 주십시오.');
}
$tmp_mb_nick = iconv('UTF-8', 'UTF-8//IGNORE', $mb_nick);
if($tmp_mb_nick != $mb_nick) {
alert('닉네임을 올바르게 입력해 주십시오.');
}
if ($w == '' && !$mb_password) if ($w == '' && !$mb_password)
alert('비밀번호가 넘어오지 않았습니다.'); alert('비밀번호가 넘어오지 않았습니다.');
if($w == '' && $mb_password != $mb_password_re) if($w == '' && $mb_password != $mb_password_re)
@@ -92,6 +114,14 @@ if ($w == '' || $w == 'u') {
if ($w=='') { if ($w=='') {
if ($msg = exist_mb_id($mb_id)) alert($msg); if ($msg = exist_mb_id($mb_id)) alert($msg);
if (get_session('ss_check_mb_id') != $mb_id || get_session('ss_check_mb_nick') != $mb_nick || get_session('ss_check_mb_email') != $mb_email) {
set_session('ss_check_mb_id', '');
set_session('ss_check_mb_nick', '');
set_session('ss_check_mb_email', '');
alert('올바른 방법으로 이용해 주십시오.');
}
// 본인확인 체크 // 본인확인 체크
if($config['cf_cert_use'] && $config['cf_cert_req']) { if($config['cf_cert_use'] && $config['cf_cert_req']) {
if(trim($_POST['cert_no']) != $_SESSION['ss_cert_no'] || !$_SESSION['ss_cert_no']) if(trim($_POST['cert_no']) != $_SESSION['ss_cert_no'] || !$_SESSION['ss_cert_no'])
@@ -119,17 +149,6 @@ if ($w == '' || $w == 'u') {
if ($msg = exist_mb_email($mb_email, $mb_id)) alert($msg, "", true, true); if ($msg = exist_mb_email($mb_email, $mb_id)) alert($msg, "", true, true);
} }
$mb_name = clean_xss_tags($mb_name);
$mb_email = get_email_address($mb_email);
$mb_homepage = clean_xss_tags($mb_homepage);
$mb_tel = clean_xss_tags($mb_tel);
$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_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
// 사용자 코드 실행 // 사용자 코드 실행
@include_once($member_skin_path.'/register_form_update.head.skin.php'); @include_once($member_skin_path.'/register_form_update.head.skin.php');
+1 -1
View File
@@ -70,7 +70,7 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level']))
wr_ip = '{$_SERVER['REMOTE_ADDR']}' "; wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($sql); sql_query($sql);
$comment_id = mysql_insert_id(); $comment_id = sql_insert_id();
// 원글에 코멘트수 증가 // 원글에 코멘트수 증가
sql_query(" update $write_table set wr_comment = wr_comment + 1 where wr_id = '$wr_id' "); sql_query(" update $write_table set wr_comment = wr_comment + 1 where wr_id = '$wr_id' ");
+1 -1
View File
@@ -120,7 +120,7 @@ if ($stx) {
$sql = " select wr_id from {$tmp_write_table} where {$sql_search} "; $sql = " select wr_id from {$tmp_write_table} where {$sql_search} ";
$result = sql_query($sql, false); $result = sql_query($sql, false);
$row['cnt'] = @mysql_num_rows($result); $row['cnt'] = @sql_num_rows($result);
$total_count += $row['cnt']; $total_count += $row['cnt'];
if ($row['cnt']) { if ($row['cnt']) {
+1 -1
View File
@@ -12,7 +12,7 @@ switch($_REQUEST['sns']) {
header("Location:http://www.facebook.com/sharer/sharer.php?s=100&u=".$short_url."&p=".$title); header("Location:http://www.facebook.com/sharer/sharer.php?s=100&u=".$short_url."&p=".$title);
break; break;
case 'twitter' : case 'twitter' :
header("Location:http://twitter.com/home?status=".$title_url); header("Location:https://twitter.com/intent/tweet?text=".$title_url);
break; break;
case 'gplus' : case 'gplus' :
header("Location:https://plus.google.com/share?url=".$short_url); header("Location:https://plus.google.com/share?url=".$short_url);
+21
View File
@@ -0,0 +1,21 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE))
return;
// Browscap 캐시 파일이 있으면 실행
if(defined('G5_VISIT_BROWSCAP_USE') && G5_VISIT_BROWSCAP_USE && is_file(G5_DATA_PATH.'/cache/browscap_cache.php')) {
include_once(G5_PLUGIN_PATH.'/browscap/Browscap.php');
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH.'/cache');
$browscap->doAutoUpdate = false;
$browscap->cacheFilename = 'browscap_cache.php';
$info = $browscap->getBrowser($_SERVER['HTTP_USER_AGENT']);
$vi_browser = $info->Comment;
$vi_os = $info->Platform;
$vi_device = $info->Device_Type;
}
?>
+7 -1
View File
@@ -15,7 +15,13 @@ if (get_cookie('ck_visit_ip') != $_SERVER['REMOTE_ADDR'])
if (isset($_SERVER['HTTP_REFERER'])) if (isset($_SERVER['HTTP_REFERER']))
$referer = escape_trim(clean_xss_tags($_SERVER['HTTP_REFERER'])); $referer = escape_trim(clean_xss_tags($_SERVER['HTTP_REFERER']));
$user_agent = escape_trim(clean_xss_tags($_SERVER['HTTP_USER_AGENT'])); $user_agent = escape_trim(clean_xss_tags($_SERVER['HTTP_USER_AGENT']));
$sql = " insert {$g5['visit_table']} ( vi_id, vi_ip, vi_date, vi_time, vi_referer, vi_agent ) values ( '{$vi_id}', '{$remote_addr}', '".G5_TIME_YMD."', '".G5_TIME_HIS."', '{$referer}', '{$user_agent}' ) "; $vi_browser = '';
$vi_os = '';
$vi_device = '';
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}' ) ";
$result = sql_query($sql, FALSE); $result = sql_query($sql, FALSE);
// 정상으로 INSERT 되었다면 방문자 합계에 반영 // 정상으로 INSERT 되었다면 방문자 합계에 반영
+1 -1
View File
@@ -167,7 +167,7 @@ if ($w == 'c') // 댓글 입력
wr_10 = '$wr_10' "; wr_10 = '$wr_10' ";
sql_query($sql); sql_query($sql);
$comment_id = mysql_insert_id(); $comment_id = sql_insert_id();
// 원글에 댓글수 증가 & 마지막 시간 반영 // 원글에 댓글수 증가 & 마지막 시간 반영
sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '".G5_TIME_YMDHIS."' where wr_id = '$wr_id' "); sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '".G5_TIME_YMDHIS."' where wr_id = '$wr_id' ");
+2 -2
View File
@@ -244,7 +244,7 @@ if ($w == '' || $w == 'r') {
wr_10 = '$wr_10' "; wr_10 = '$wr_10' ";
sql_query($sql); sql_query($sql);
$wr_id = mysql_insert_id(); $wr_id = sql_insert_id();
// 부모 아이디에 UPDATE // 부모 아이디에 UPDATE
sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' "); sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");
@@ -485,7 +485,7 @@ for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
$shuffle = implode('', $chars_array); $shuffle = implode('', $chars_array);
// 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925) // 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925)
$upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.str_replace('%', '', urlencode(str_replace(' ', '_', $filename))); $upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.replace_filename($filename);
$dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$upload[$i]['file']; $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$upload[$i]['file'];
+1 -1
View File
@@ -135,7 +135,7 @@ if (file_exists($dbconfig_file)) {
// mysql connect resource $g5 배열에 저장 - 명랑폐인님 제안 // mysql connect resource $g5 배열에 저장 - 명랑폐인님 제안
$g5['connect_db'] = $connect_db; $g5['connect_db'] = $connect_db;
sql_query(" set names utf8 "); sql_set_charset('utf8', $connect_db);
if(defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE) sql_query("SET SESSION sql_mode = ''"); if(defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE) sql_query("SET SESSION sql_mode = ''");
if (defined(G5_TIMEZONE)) sql_query(" set time_zone = '".G5_TIMEZONE."'"); if (defined(G5_TIMEZONE)) sql_query(" set time_zone = '".G5_TIMEZONE."'");
} else { } else {
+10 -1
View File
@@ -5,7 +5,7 @@
********************/ ********************/
define('G5_VERSION', '그누보드5'); define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.1.2'); define('G5_GNUBOARD_VER', '5.1.7');
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음 // 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
define('_GNUBOARD_', true); define('_GNUBOARD_', true);
@@ -195,6 +195,15 @@ define('G5_THUMB_PNG_COMPRESS', 5);
// 모바일 기기에서 DHTML 에디터 사용여부를 설정합니다. // 모바일 기기에서 DHTML 에디터 사용여부를 설정합니다.
define('G5_IS_MOBILE_DHTML_USE', false); define('G5_IS_MOBILE_DHTML_USE', false);
// MySQLi 사용여부를 설정합니다.
define('G5_MYSQLI_USE', true);
// Browscap 사용여부를 설정합니다.
define('G5_BROWSCAP_USE', true);
// 접속자 기록 때 Browscap 사용여부를 설정합니다.
define('G5_VISIT_BROWSCAP_USE', false);
// ip 숨김방법 설정 // ip 숨김방법 설정
/* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은 /* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은
\\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로 \\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로
+16 -8
View File
@@ -119,17 +119,25 @@ a:hover, a:focus, a:active {color:#000;text-decoration:underline}
/* ie6 이미지 너비 지정 */ /* ie6 이미지 너비 지정 */
.img_fix {width:100%;height:auto} .img_fix {width:100%;height:auto}
/* 캡챠 자동등록(입력)방지 기본 */ /* 캡챠 자동등록(입력)방지 기본 -pc */
#captcha {display:inline-block;position:relative} #captcha {display:inline-block;position:relative}
#captcha legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden} #captcha legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden;}
#captcha #captcha_img {width:100px;height:41px;border:1px solid #e9e9e9} #captcha #captcha_img {width:160px;height:60px;border:1px solid #e9e9e9;vertical-align:top;padding:0;margin:0}
#captcha #captcha_mp3 {position:absolute;top:0;left:101px;;margin:0;padding:0;width:23px;height:22px;border:0;background:transparent;vertical-align:middle;overflow:hidden;cursor:pointer} #captcha #captcha_mp3 {position:absolute;top:0;left:161px;;margin:0;padding:0;width:31px;height:31px;border:0;background:transparent;vertical-align:middle;overflow:hidden;cursor:pointer}
#captcha #captcha_mp3 span {position:absolute;top:0;left:0;width:23px;height:22px;background:url('../plugin/kcaptcha/img/sound.gif')} #captcha #captcha_mp3 span {position:absolute;top:0;left:0;width:31px;height:31px;background:url('../img/captcha.png') no-repeat;}
#captcha #captcha_reload {position:absolute;top:21px;left:101px;margin:0;padding:0;width:23px;height:22px;border:0;background:transparent;vertical-align:middle;overflow:hidden;cursor:pointer} #captcha #captcha_reload {position:absolute;top:31px;left:161px;margin:0;padding:0;width:31px;height:31px;border:0;background:transparent;vertical-align:middle;overflow:hidden;cursor:pointer;background:url('../img/captcha.png') no-repeat 0 -30px;border-top:1px solid #ccc;text-indent:-999px}
#captcha #captcha_reload span {position:absolute;top:0;left:0;width:23px;height:22px;background:url('../plugin/kcaptcha/img/reload.gif')} #captcha #captcha_key {margin:0 0 0 33px;padding:0 5px;width:70px;height:60px;border:1px solid #b8c9c2;background:#f7f7f7;font-size:1.333em;font-weight:bold;text-align:center;line-height:2.8em;vertical-align:top}
#captcha #captcha_key {margin:0 0 0 25px;padding:0 5px;width:70px;height:41px;border:1px solid #b8c9c2;background:#f7f7f7;font-size:1.333em;font-weight:bold;text-align:center;line-height:2.8em}
#captcha #captcha_info {display:block;margin:5px 0 0;font-size:0.95em;letter-spacing:-0.1em} #captcha #captcha_info {display:block;margin:5px 0 0;font-size:0.95em;letter-spacing:-0.1em}
/* 캡챠 자동등록(입력)방지 기본 - mobile */
#captcha.m_captcha audio {display:block;margin:0 0 5px;width:187px}
#captcha.m_captcha #captcha_img {width:160px;height:60px;border:1px solid #e9e9e9;margin-bottom:3px;margin-top:5px;display:block;}
#captcha.m_captcha #captcha_reload {position:static;margin:0;padding:0;width:31px;height:31px;border:0;background:transparent;vertical-align:middle;overflow:hidden;cursor:pointer;background:url('../../../img/captcha.png') no-repeat 0 -30px;text-indent:-999px}
#captcha.m_captcha #captcha_reload span{display:none;}
#captcha.m_captcha #captcha_key {margin:0;padding:0 5px;width:115px;height:29px;border:1px solid #b8c9c2;background:#f7f7f7;font-size:1.333em;font-weight:bold;text-align:center;line-height:29px;margin-left:3px}
#captcha.m_captcha #captcha_info {display:block;margin:5px 0 0;font-size:0.95em;letter-spacing:-0.1em}
#captcha.m_captcha #captcha_mp3 {width:31px;height:31px;background:url('../img/captcha.png') no-repeat; vertical-align:top;overflow:hidden;cursor:pointer;text-indent:-9999px;border:none}
/* ckeditor 단축키 */ /* ckeditor 단축키 */
.cke_sc {margin:0 0 5px;text-align:right} .cke_sc {margin:0 0 5px;text-align:right}
.btn_cke_sc{display:inline-block;padding:0 10px;height:23px;border:1px solid #ccc;background:#fafafa;color:#000;text-decoration:none;line-height:1.9em;vertical-align:middle;cursor:pointer} .btn_cke_sc{display:inline-block;padding:0 10px;height:23px;border:1px solid #ccc;background:#fafafa;color:#000;text-decoration:none;line-height:1.9em;vertical-align:middle;cursor:pointer}
+19 -8
View File
@@ -53,7 +53,7 @@ a:hover, a:focus, a:active {color:#000;text-decoration:underline}
#hd_sch {display:none;border-top:1px solid #181818;background:#282828;text-align:center} #hd_sch {display:none;border-top:1px solid #181818;background:#282828;text-align:center}
#hd_sch h2 {position:absolute;font-size:0;text-indent:-9999em;line-height:0;overflow:hidden} #hd_sch h2 {position:absolute;font-size:0;text-indent:-9999em;line-height:0;overflow:hidden}
#hd_sch form {position:relative;padding:30px 0} #hd_sch form {position:relative;padding:30px 0}
#hd_sch #sch_stx {height:30px;border:1px solid #181818;background:#323232 !important;line-height:2.5em;vertical-align:middle} #hd_sch #sch_stx {height:30px;border:1px solid #181818;background:#323232 !important;line-height:2.5em;vertical-align:middle;color:#ccc}
#hd_sch #sch_submit {margin:0;padding:0 10px;height:32px;border:0;background:#000;color:#fff;vertical-align:middle} #hd_sch #sch_submit {margin:0;padding:0 10px;height:32px;border:0;background:#000;color:#fff;vertical-align:middle}
#hd_sch #sch_close {display:block;margin:0;padding:10px 0;width:100%;border:0;background:#000;color:#fff} #hd_sch #sch_close {display:block;margin:0;padding:10px 0;width:100%;border:0;background:#000;color:#fff}
@@ -109,15 +109,26 @@ a:hover, a:focus, a:active {color:#000;text-decoration:underline}
/* 이미지 등비율 리사이징 */ /* 이미지 등비율 리사이징 */
.img_fix {width:100%;height:auto} .img_fix {width:100%;height:auto}
/* 캡챠 자동등록(입력)방지 기본 */ /* 캡챠 자동등록(입력)방지 기본 - PC */
#captcha {display:inline-block;position:relative} #captcha {display:inline-block;position:relative;}
#captcha legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden} #captcha legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden;font-size:0}
#captcha audio {display:block;margin:0 0 5px;width:187px} #captcha audio {display:block;margin:0 0 5px;width:187px}
#captcha #captcha_img {width:60px;height:30px;border:1px solid #e9e9e9} #captcha #captcha_img {width:160px;height:60px;border:1px solid #e9e9e9;margin-bottom:3px;margin-right:32px;vertical-align:top}
#captcha #captcha_reload {margin:0;padding:0 5px;height:32px;border:0;background:#e4eaec;vertical-align:middle;overflow:hidden;cursor:pointer} #captcha #captcha_reload {position:absolute;top:31px;left:161px;width:31px;height:31px;background:url('../img/captcha.png') no-repeat 0 -30px;border:none;border-top:1px solid #ccc;overflow:hidden;cursor:pointer;text-indent:-9999px;}
#captcha #captcha_key {margin:0 0 0 4px;padding:0 5px;width:50px;height:30px;border:1px solid #b8c9c2;background:#f7f7f7;font-size:1.333em;font-weight:bold;text-align:center;line-height:2em} #captcha #captcha_key {margin:0;padding:0 5px;width:70px;height:60px;border:1px solid #b8c9c2;background:#f7f7f7;font-size:1.333em;font-weight:bold;text-align:center;line-height:2.8em;vertical-align:top}
#captcha #captcha_info {display:block;margin:5px 0 0;font-size:0.95em;letter-spacing:-0.1em} #captcha #captcha_info {display:block;margin:5px 0 0;font-size:0.95em;letter-spacing:-0.1em}
#captcha #captcha_mp3{margin:0;padding:0 5px;height:32px;border:0;background:#e4eaec;vertical-align:middle;overflow:hidden;cursor:pointer} #captcha #captcha_mp3 {position:absolute;top:0;left:161px;width:31px;height:31px;background:url('../img/captcha.png') no-repeat; vertical-align:top;overflow:hidden;cursor:pointer;text-indent:-9999px;border:none}
/* 캡챠 자동등록(입력)방지 기본 - mobile */
#captcha.m_captcha legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden;font-size:0}
#captcha.m_captcha audio {display:block;margin:0 0 5px;width:187px}
#captcha.m_captcha #captcha_img {width:160px;height:60px;border:1px solid #e9e9e9;margin-bottom:3px;display:block;}
#captcha.m_captcha #captcha_reload {width:31px;height:31px;background:url('../img/captcha.png') no-repeat 0 -30px;border:none;overflow:hidden;cursor:pointer;text-indent:-9999px;position:static}
#captcha.m_captcha #captcha_key {margin:0;padding:0 5px;width:115px;height:29px;border:1px solid #b8c9c2;background:#f7f7f7;font-size:1.333em;font-weight:bold;text-align:center;line-height:29px;margin-left:3px}
#captcha.m_captcha #captcha_info {display:block;margin:5px 0 0;font-size:0.95em;letter-spacing:-0.1em}
#captcha.m_captcha #captcha_mp3 {width:31px;height:31px;background:url('../img/captcha.png') no-repeat; vertical-align:top;overflow:hidden;cursor:pointer;text-indent:-9999px;border:none}
/*단축키일람 */ /*단축키일람 */
.btn_cke_sc{background:#333;color:#fff;padding:5px;border:none;margin-bottom:5px} .btn_cke_sc{background:#333;color:#fff;padding:5px;border:none;margin-bottom:5px}
-13
View File
@@ -22,23 +22,10 @@ $g5['sms5_book_table'] = $g5['sms5_prefix'] . 'book';
$g5['sms5_book_group_table'] = $g5['sms5_prefix'] . 'book_group'; $g5['sms5_book_group_table'] = $g5['sms5_prefix'] . 'book_group';
$g5['sms5_form_table'] = $g5['sms5_prefix'] . 'form'; $g5['sms5_form_table'] = $g5['sms5_prefix'] . 'form';
$g5['sms5_form_group_table'] = $g5['sms5_prefix'] . 'form_group'; $g5['sms5_form_group_table'] = $g5['sms5_prefix'] . 'form_group';
$g5['sms5_member_history_table'] = $g5['sms5_prefix'] . 'member_history';
if (!empty($config['cf_sms_use'])) { if (!empty($config['cf_sms_use'])) {
$sms5 = sql_fetch("select * from {$g5['sms5_config_table']} ", false); $sms5 = sql_fetch("select * from {$g5['sms5_config_table']} ", false);
if( $sms5['cf_member'] && trim($member['mb_hp']) ) {
$g5['sms5_use_sideview'] = true; //회원 사이드뷰 레이어에 추가
} else {
$g5['sms5_use_sideview'] = false;
}
//==============================================================================
// 스킨경로
//------------------------------------------------------------------------------
$sms5_skin_path = G5_SMS5_PATH.'/skin/'.$sms5['cf_skin']; //sms5 스킨 path
$sms5_skin_url = G5_SMS5_URL .'/skin/'.$sms5['cf_skin']; //sms5 스킨 url
// Demo 설정 // Demo 설정
if (file_exists(G5_PATH.'/DEMO')) if (file_exists(G5_PATH.'/DEMO'))
+5 -35
View File
@@ -169,13 +169,7 @@ document.onkeydown = noRefresh ;
$is_euckr = true; $is_euckr = true;
// member table 복사 // member table 복사
$columns = array(); $columns = sql_field_names($g5['member_table']);
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['member_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$sql = " select * from {$g4['member_table']} "; $sql = " select * from {$g4['member_table']} ";
$result = sql_query($sql); $result = sql_query($sql);
@@ -325,13 +319,7 @@ document.onkeydown = noRefresh ;
echo '<li>visit sum table 복사</li>'.PHP_EOL; echo '<li>visit sum table 복사</li>'.PHP_EOL;
// group table 복사 // group table 복사
$columns = array(); $columns = sql_field_names($g5['group_table']);
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['group_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$sql = " select * from {$g4['group_table']} "; $sql = " select * from {$g4['group_table']} ";
$result = sql_query($sql); $result = sql_query($sql);
@@ -365,13 +353,7 @@ document.onkeydown = noRefresh ;
unset($fiels); unset($fiels);
// board 복사 // board 복사
$columns = array(); $columns = sql_field_names($g5['board_table']);
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['board_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$sql = " select * from {$g4['board_table']} "; $sql = " select * from {$g4['board_table']} ";
$result = sql_query($sql); $result = sql_query($sql);
@@ -413,13 +395,7 @@ document.onkeydown = noRefresh ;
// 게시글 복사 // 게시글 복사
if(sql_query($sql, FALSE)) { if(sql_query($sql, FALSE)) {
$write_table = $g4['write_prefix'].$bo_table; $write_table = $g4['write_prefix'].$bo_table;
$columns2 = array(); $columns2 = sql_field_names($create_table);
$fields2 = mysql_list_fields(G5_MYSQL_DB, $create_table);
$count2 = mysql_num_fields($fields2);
for ($j = 0; $j < $count2; $j++) {
$fld = mysql_field_name($fields2, $j);
$columns2[] = $fld;
}
$sql3 = " select * from $write_table "; $sql3 = " select * from $write_table ";
$result3 = sql_query($sql3); $result3 = sql_query($sql3);
@@ -461,13 +437,7 @@ document.onkeydown = noRefresh ;
$tables = array('board_file', 'board_new', 'board_good', 'mail', 'memo', 'group_member', 'auth', 'popular', 'poll', 'poll_etc', 'scrap'); $tables = array('board_file', 'board_new', 'board_good', 'mail', 'memo', 'group_member', 'auth', 'popular', 'poll', 'poll_etc', 'scrap');
foreach($tables as $table) { foreach($tables as $table) {
$columns = array(); $columns = sql_field_names($g5[$table.'_table']);
$fields = mysql_list_fields(G5_MYSQL_DB, $g5[$table.'_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$src_table = $g4[$table.'_table']; $src_table = $g4[$table.'_table'];
$dst_table = $g5[$table.'_table']; $dst_table = $g5[$table.'_table'];
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+17 -13
View File
@@ -8,6 +8,8 @@ header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0 header('Pragma: no-cache'); // HTTP/1.0
include_once ('../config.php'); include_once ('../config.php');
include_once ('../lib/common.lib.php');
$title = G5_VERSION." 설치 완료 3/3"; $title = G5_VERSION." 설치 완료 3/3";
include_once ('./install.inc.php'); include_once ('./install.inc.php');
@@ -23,7 +25,7 @@ $admin_pass = $_POST['admin_pass'];
$admin_name = $_POST['admin_name']; $admin_name = $_POST['admin_name'];
$admin_email = $_POST['admin_email']; $admin_email = $_POST['admin_email'];
$dblink = @mysql_connect($mysql_host, $mysql_user, $mysql_pass); $dblink = sql_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
if (!$dblink) { if (!$dblink) {
?> ?>
@@ -37,7 +39,7 @@ if (!$dblink) {
exit; exit;
} }
$select_db = @mysql_select_db($mysql_db, $dblink); $select_db = sql_select_db($mysql_db, $dblink);
if (!$select_db) { if (!$select_db) {
?> ?>
@@ -52,12 +54,14 @@ if (!$select_db) {
} }
$mysql_set_mode = 'false'; $mysql_set_mode = 'false';
@mysql_query('set names utf8'); sql_set_charset('utf8', $dblink);
$row = mysql_fetch_assoc(mysql_query(" SELECT @@sql_mode as mode ")); $result = sql_query(" SELECT @@sql_mode as mode ", true, $dblink);
$row = sql_fetch_array($result);
if($row['mode']) { if($row['mode']) {
@mysql_query("SET SESSION sql_mode = ''"); sql_query("SET SESSION sql_mode = ''", true, $dblink);
$mysql_set_mode = 'true'; $mysql_set_mode = 'true';
} }
unset($result);
unset($row); unset($row);
?> ?>
@@ -75,7 +79,7 @@ $file = preg_replace('/`g5_([^`]+`)/', '`'.$table_prefix.'$1', $file);
$f = explode(';', $file); $f = explode(';', $file);
for ($i=0; $i<count($f); $i++) { for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == '') continue; if (trim($f[$i]) == '') continue;
mysql_query($f[$i]) or die(mysql_error()); sql_query($f[$i], true, $dblink);
} }
// 테이블 생성 ------------------------------------ // 테이블 생성 ------------------------------------
?> ?>
@@ -154,14 +158,14 @@ $sql = " insert into `{$table_prefix}config`
cf_stipulation = '해당 홈페이지에 맞는 회원가입약관을 입력합니다.', cf_stipulation = '해당 홈페이지에 맞는 회원가입약관을 입력합니다.',
cf_privacy = '해당 홈페이지에 맞는 개인정보처리방침을 입력합니다.' cf_privacy = '해당 홈페이지에 맞는 개인정보처리방침을 입력합니다.'
"; ";
mysql_query($sql) or die(mysql_error() . "<p>" . $sql); sql_query($sql, true, $dblink);
// 1:1문의 설정 // 1:1문의 설정
$sql = " insert into `{$table_prefix}qa_config` $sql = " insert into `{$table_prefix}qa_config`
( qa_title, qa_category, qa_skin, qa_mobile_skin, qa_use_email, qa_req_email, qa_use_hp, qa_req_hp, qa_use_editor, qa_subject_len, qa_mobile_subject_len, qa_page_rows, qa_mobile_page_rows, qa_image_width, qa_upload_size, qa_insert_content ) ( qa_title, qa_category, qa_skin, qa_mobile_skin, qa_use_email, qa_req_email, qa_use_hp, qa_req_hp, qa_use_editor, qa_subject_len, qa_mobile_subject_len, qa_page_rows, qa_mobile_page_rows, qa_image_width, qa_upload_size, qa_insert_content )
values values
( '1:1문의', '회원|포인트', 'basic', 'basic', '1', '0', '1', '0', '1', '60', '30', '15', '15', '600', '1048576', '' ) "; ( '1:1문의', '회원|포인트', 'basic', 'basic', '1', '0', '1', '0', '1', '60', '30', '15', '15', '600', '1048576', '' ) ";
mysql_query($sql); sql_query($sql, true, $dblink);
// 관리자 회원가입 // 관리자 회원가입
$sql = " insert into `{$table_prefix}member` $sql = " insert into `{$table_prefix}member`
@@ -177,15 +181,15 @@ $sql = " insert into `{$table_prefix}member`
mb_datetime = '".G5_TIME_YMDHIS."', mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$_SERVER['REMOTE_ADDR']}' mb_ip = '{$_SERVER['REMOTE_ADDR']}'
"; ";
@mysql_query($sql); sql_query($sql, true, $dblink);
// 내용관리 생성 // 내용관리 생성
@mysql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ") or die(mysql_error() . "<p>" . $sql); sql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", true, $dblink);
@mysql_query(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ") or die(mysql_error() . "<p>" . $sql); sql_query(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ", true, $dblink);
@mysql_query(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ") or die(mysql_error() . "<p>" . $sql); sql_query(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ", true, $dblink);
// FAQ Master // FAQ Master
@mysql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ") or die(mysql_error() . "<p>" . $sql); sql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ", true, $dblink);
?> ?>
<li>DB설정 완료</li> <li>DB설정 완료</li>
-13
View File
@@ -503,14 +503,6 @@ var win_zip = function(frm_name, frm_zip, frm_addr1, frm_addr2, frm_addr3, frm_j
} }
} }
/**
* sms5 창
**/
var win_sms5 = function(href) {
var new_win = window.open(href, 'win_sms5', 'width=474, height=560, scrollbars=1');
new_win.focus();
}
/** /**
* 새로운 비밀번호 분실 창 : 101123 * 새로운 비밀번호 분실 창 : 101123
**/ **/
@@ -590,11 +582,6 @@ $(function(){
return false; return false;
}); });
$(".win_sms5").click(function() {
win_sms5(this.href);
return false;
});
/* /*
$(".win_poll").click(function() { $(".win_poll").click(function() {
win_poll(this.href); win_poll(this.href);
Binary file not shown.
+1 -1
View File
@@ -28,7 +28,7 @@
//require_once 'PEAR.php'; //require_once 'PEAR.php';
require_once 'oleread.inc'; require_once 'oleread.inc.php';
//require_once 'OLE.php'; //require_once 'OLE.php';
define('SPREADSHEET_EXCEL_READER_BIFF8', 0x600); define('SPREADSHEET_EXCEL_READER_BIFF8', 0x600);
+180 -24
View File
@@ -562,8 +562,9 @@ function html_purifier($html)
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
// data/cache 디렉토리에 CSS, HTML, URI 디렉토리 등을 만든다. // data/cache 디렉토리에 CSS, HTML, URI 디렉토리 등을 만든다.
$config->set('Cache.SerializerPath', G5_DATA_PATH.'/cache'); $config->set('Cache.SerializerPath', G5_DATA_PATH.'/cache');
$config->set('HTML.SafeEmbed', true); $config->set('HTML.SafeEmbed', false);
$config->set('HTML.SafeObject', true); $config->set('HTML.SafeObject', false);
$config->set('Output.FlashCompat', false);
$config->set('HTML.SafeIframe', true); $config->set('HTML.SafeIframe', true);
$config->set('URI.SafeIframeRegexp','%^(https?:)?//('.$safeiframe.')%'); $config->set('URI.SafeIframeRegexp','%^(https?:)?//('.$safeiframe.')%');
$config->set('Attr.AllowedFrameTargets', array('_blank')); $config->set('Attr.AllowedFrameTargets', array('_blank'));
@@ -1260,10 +1261,6 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
} }
if($mb_id) if($mb_id)
$str2 .= "<a href=\"".G5_BBS_URL."/new.php?mb_id=".$mb_id."\">전체게시물</a>\n"; $str2 .= "<a href=\"".G5_BBS_URL."/new.php?mb_id=".$mb_id."\">전체게시물</a>\n";
if($g5['sms5_use_sideview']){
$mb = get_member($mb_id, " mb_open, mb_sms , mb_hp ");
if( $mb['mb_open'] && $mb['mb_sms'] && $mb['mb_hp'] ) $str2 .= "<a href=\"".G5_SMS5_URL."/?mb_id=".$mb_id."\" class=\"win_sms5\" target=\"_blank\">문자보내기</a>\n";
}
if($is_admin == "super" && $mb_id) { if($is_admin == "super" && $mb_id) {
$str2 .= "<a href=\"".G5_ADMIN_URL."/member_form.php?w=u&amp;mb_id=".$mb_id."\" target=\"_blank\">회원정보변경</a>\n"; $str2 .= "<a href=\"".G5_ADMIN_URL."/member_form.php?w=u&amp;mb_id=".$mb_id."\" target=\"_blank\">회원정보변경</a>\n";
$str2 .= "<a href=\"".G5_ADMIN_URL."/point_list.php?sfl=mb_id&amp;stx=".$mb_id."\" target=\"_blank\">포인트내역</a>\n"; $str2 .= "<a href=\"".G5_ADMIN_URL."/point_list.php?sfl=mb_id&amp;stx=".$mb_id."\" target=\"_blank\">포인트내역</a>\n";
@@ -1416,11 +1413,22 @@ function html_symbol($str)
*************************************************************************/ *************************************************************************/
// DB 연결 // DB 연결
function sql_connect($host, $user, $pass) function sql_connect($host, $user, $pass, $db=G5_MYSQL_DB)
{ {
global $g5; global $g5;
return @mysql_connect($host, $user, $pass); if(function_exists('mysqli_connect') && G5_MYSQLI_USE) {
$link = mysqli_connect($host, $user, $pass, $db);
// 연결 오류 발생 시 스크립트 종료
if (mysqli_connect_errno()) {
die('Connect Error: '.mysqli_connect_error());
}
} else {
$link = mysql_connect($host, $user, $pass);
}
return $link;
} }
@@ -1429,16 +1437,36 @@ function sql_select_db($db, $connect)
{ {
global $g5; global $g5;
return @mysql_select_db($db, $connect); if(function_exists('mysqli_select_db') && G5_MYSQLI_USE)
return @mysqli_select_db($connect, $db);
else
return @mysql_select_db($db, $connect);
} }
// mysql_query 와 mysql_error 를 한꺼번에 처리 function sql_set_charset($charset, $link=null)
// mysql connect resource 지정 - 명랑폐인님 제안
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR)
{ {
global $g5; global $g5;
if(!$link)
$link = $g5['connect_db'];
if(function_exists('mysqli_set_charset') && G5_MYSQLI_USE)
mysqli_set_charset($link, $charset);
else
mysql_query(" set names {$charset} ", $link);
}
// mysqli_query 와 mysqli_error 를 한꺼번에 처리
// mysql connect resource 지정 - 명랑폐인님 제안
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
// Blind SQL Injection 취약점 해결 // Blind SQL Injection 취약점 해결
$sql = trim($sql); $sql = trim($sql);
// union의 사용을 허락하지 않습니다. // union의 사용을 허락하지 않습니다.
@@ -1447,20 +1475,34 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR)
// `information_schema` DB로의 접근을 허락하지 않습니다. // `information_schema` DB로의 접근을 허락하지 않습니다.
$sql = preg_replace("#^select.*from.*where.*`?information_schema`?.*#i", "select 1", $sql); $sql = preg_replace("#^select.*from.*where.*`?information_schema`?.*#i", "select 1", $sql);
if ($error) if(function_exists('mysqli_query') && G5_MYSQLI_USE) {
$result = @mysql_query($sql, $g5['connect_db']) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['SCRIPT_NAME']}"); if ($error) {
else $result = @mysqli_query($link, $sql) or die("<p>$sql<p>" . mysqli_errno($link) . " : " . mysqli_error($link) . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
$result = @mysql_query($sql, $g5['connect_db']); } else {
$result = @mysqli_query($link, $sql);
}
} else {
if ($error) {
$result = @mysql_query($sql, $link) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
} else {
$result = @mysql_query($sql, $link);
}
}
return $result; return $result;
} }
// 쿼리를 실행한 후 결과값에서 한행을 얻는다. // 쿼리를 실행한 후 결과값에서 한행을 얻는다.
function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR) function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
{ {
$result = sql_query($sql, $error); global $g5;
//$row = @sql_fetch_array($result) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : $_SERVER['SCRIPT_NAME']");
if(!$link)
$link = $g5['connect_db'];
$result = sql_query($sql, $error, $link);
//$row = @sql_fetch_array($result) or die("<p>$sql<p>" . mysqli_errno() . " : " . mysqli_error() . "<p>error file : $_SERVER['SCRIPT_NAME']");
$row = sql_fetch_array($result); $row = sql_fetch_array($result);
return $row; return $row;
} }
@@ -1469,7 +1511,11 @@ function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR)
// 결과값에서 한행 연관배열(이름으로)로 얻는다. // 결과값에서 한행 연관배열(이름으로)로 얻는다.
function sql_fetch_array($result) function sql_fetch_array($result)
{ {
$row = @mysql_fetch_assoc($result); if(function_exists('mysqli_fetch_assoc') && G5_MYSQLI_USE)
$row = @mysqli_fetch_assoc($result);
else
$row = @mysql_fetch_assoc($result);
return $row; return $row;
} }
@@ -1479,7 +1525,10 @@ function sql_fetch_array($result)
// 단, 결과 값은 스크립트(script) 실행부가 종료되면서 메모리에서 자동적으로 지워진다. // 단, 결과 값은 스크립트(script) 실행부가 종료되면서 메모리에서 자동적으로 지워진다.
function sql_free_result($result) function sql_free_result($result)
{ {
return mysql_free_result($result); if(function_exists('mysqli_free_result') && G5_MYSQLI_USE)
return mysqli_free_result($result);
else
return mysql_free_result($result);
} }
@@ -1493,6 +1542,74 @@ function sql_password($value)
} }
function sql_insert_id($link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
if(function_exists('mysqli_insert_id') && G5_MYSQLI_USE)
return mysqli_insert_id($link);
else
return mysql_insert_id($link);
}
function sql_num_rows($result)
{
if(function_exists('mysqli_num_rows') && G5_MYSQLI_USE)
return mysqli_num_rows($result);
else
return mysql_num_rows($result);
}
function sql_field_names($table, $link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
$columns = array();
$sql = " select * from `$table` limit 1 ";
$result = sql_query($sql, $link);
if(function_exists('mysqli_fetch_field') && G5_MYSQLI_USE) {
while($field = mysqli_fetch_field($result)) {
$columns[] = $field->name;
}
} else {
$i = 0;
$cnt = mysql_num_fields($result);
while($i < $cnt) {
$field = mysql_fetch_field($result, $i);
$columns[] = $field->name;
$i++;
}
}
return $columns;
}
function sql_error_info($link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
if(function_exists('mysqli_error') && G5_MYSQLI_USE) {
return mysqli_errno($link) . ' : ' . mysqli_error($link);
} else {
return mysql_errno($link) . ' : ' . mysql_error($link);
}
}
// PHPMyAdmin 참고 // PHPMyAdmin 참고
function get_table_define($table, $crlf="\n") function get_table_define($table, $crlf="\n")
{ {
@@ -1893,12 +2010,15 @@ function convert_charset($from_charset, $to_charset, $str)
} }
// mysql_real_escape_string 의 alias 기능을 한다. // mysqli_real_escape_string 의 alias 기능을 한다.
function sql_real_escape_string($field) function sql_real_escape_string($str, $link=null)
{ {
global $g5; global $g5;
return mysql_real_escape_string($field, $g5['connect_db']); if(!$link)
$link = $g5['connect_db'];
return mysqli_real_escape_string($link, $str);
} }
function escape_trim($field) function escape_trim($field)
@@ -2794,6 +2914,17 @@ function get_safe_filename($name)
return $name; return $name;
} }
// 파일명 치환
function replace_filename($name)
{
@session_start();
$ss_id = session_id();
$usec = get_microtime();
$ext = array_pop(explode('.', $name));
return sha1($ss_id.$_SERVER['REMOTE_ADDR'].$usec).'.'.$ext;
}
// 아이코드 사용자정보 // 아이코드 사용자정보
function get_icode_userinfo($id, $pass) function get_icode_userinfo($id, $pass)
{ {
@@ -3017,4 +3148,29 @@ function get_skin_url($dir, $skin)
return str_replace(G5_PATH, G5_URL, $skin_path); return str_replace(G5_PATH, G5_URL, $skin_path);
} }
// 발신번호 유효성 체크
function check_vaild_callback($callback){
$_callback = preg_replace('/[^0-9]/','', $callback);
/**
* 1588 로시작하면 총8자리인데 7자리라 차단
* 02 로시작하면 총9자리 또는 10자리인데 11자리라차단
* 1366은 그자체가 원번호이기에 다른게 붙으면 차단
* 030으로 시작하면 총10자리 또는 11자리인데 9자리라차단
*/
if( substr($_callback,0,4) == '1588') if( strlen($_callback) != 8) return false;
if( substr($_callback,0,2) == '02') if( strlen($_callback) != 9 && strlen($_callback) != 10 ) return false;
if( substr($_callback,0,3) == '030') if( strlen($_callback) != 10 && strlen($_callback) != 11 ) return false;
if( !preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080|007)\-?\d{3,4}\-?\d{4,5}$/",$_callback) &&
!preg_match("/^(15|16|18)\d{2}\-?\d{4,5}$/",$_callback) ){
return false;
} else if( preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080)\-?0{3,4}\-?\d{4}$/",$_callback )) {
return false;
} else {
return true;
}
}
?> ?>
+2 -2
View File
@@ -1,7 +1,7 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; if (!defined('_GNUBOARD_')) exit;
@ini_set('memory_limit', '512M'); @ini_set('memory_limit', '-1');
// 게시글리스트 썸네일 생성 // 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3') function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3')
@@ -474,7 +474,7 @@ and the roundoff errors in the Gaussian blur process, are welcome.
$radius = abs(round($radius)); // Only integers make sense. $radius = abs(round($radius)); // Only integers make sense.
if ($radius == 0) { if ($radius == 0) {
return $img; imagedestroy($img); break; } return $img; imagedestroy($img); }
$w = imagesx($img); $h = imagesy($img); $w = imagesx($img); $h = imagesy($img);
$imgCanvas = imagecreatetruecolor($w, $h); $imgCanvas = imagecreatetruecolor($w, $h);
$imgBlur = imagecreatetruecolor($w, $h); $imgBlur = imagecreatetruecolor($w, $h);
+24 -1
View File
@@ -22,7 +22,30 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<section id="fregister_private"> <section id="fregister_private">
<h2>개인정보처리방침안내</h2> <h2>개인정보처리방침안내</h2>
<textarea readonly><?php echo get_text($config['cf_privacy']) ?></textarea> <div class="tbl_head01 tbl_wrap">
<table>
<caption>개인정보처리방침안내</caption>
<thead>
<tr>
<th>목적</th>
<th>항목</th>
<th>보유기간</th>
</tr>
</thead>
<tbody>
<tr>
<td>이용자 식별 및 본인여부 확인</td>
<td>아이디, 이름, 비밀번호</td>
<td>회원 탈퇴 시까지</td>
</tr>
<tr>
<td>고객서비스 이용에 관한 통지,<br>CS대응을 위한 이용자 식별</td>
<td>연락처 (이메일, 휴대전화번호)</td>
<td>회원 탈퇴 시까지</td>
</tr>
</tbody>
</table>
</div>
<fieldset class="fregister_agree"> <fieldset class="fregister_agree">
<label for="agree21">개인정보처리방침안내의 내용에 동의합니다.</label> <label for="agree21">개인정보처리방침안내의 내용에 동의합니다.</label>
<input type="checkbox" name="agree2" value="1" id="agree21"> <input type="checkbox" name="agree2" value="1" id="agree21">
+4
View File
@@ -80,6 +80,10 @@
.fregister_agree label {display:inline-block;margin-right:5px} .fregister_agree label {display:inline-block;margin-right:5px}
#fregister p {color:#e8180c;text-align:center} #fregister p {color:#e8180c;text-align:center}
#fregister .btn_confirm {margin:15px 0} #fregister .btn_confirm {margin:15px 0}
#fregister_private .tbl_head01 {margin:0}
#fregister_private .tbl_head01 th{;text-align:center;border:1px solid #d1dee2;width:33%}
#fregister_private .tbl_head01 td {border:1px solid #e9e9e9;background:#fff}
#fregister_private .tbl_head01 caption{position:absolute;font-size:0;line-height:0;overflow:hidden;top:0;color:#fff}
/* 회원가입 입력 */ /* 회원가입 입력 */
#fregisterform #reg_mb_email, #fregisterform .frm_address {width:100%} #fregisterform #reg_mb_email, #fregisterform .frm_address {width:100%}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,44 +1,48 @@
<?php <?php
/** /**
* Converts HTMLPurifier_ConfigSchema_Interchange to our runtime * Converts HTMLPurifier_ConfigSchema_Interchange to our runtime
* representation used to perform checks on user configuration. * representation used to perform checks on user configuration.
*/ */
class HTMLPurifier_ConfigSchema_Builder_ConfigSchema class HTMLPurifier_ConfigSchema_Builder_ConfigSchema
{ {
public function build($interchange) { /**
$schema = new HTMLPurifier_ConfigSchema(); * @param HTMLPurifier_ConfigSchema_Interchange $interchange
foreach ($interchange->directives as $d) { * @return HTMLPurifier_ConfigSchema
$schema->add( */
$d->id->key, public function build($interchange)
$d->default, {
$d->type, $schema = new HTMLPurifier_ConfigSchema();
$d->typeAllowsNull foreach ($interchange->directives as $d) {
); $schema->add(
if ($d->allowed !== null) { $d->id->key,
$schema->addAllowedValues( $d->default,
$d->id->key, $d->type,
$d->allowed $d->typeAllowsNull
); );
} if ($d->allowed !== null) {
foreach ($d->aliases as $alias) { $schema->addAllowedValues(
$schema->addAlias( $d->id->key,
$alias->key, $d->allowed
$d->id->key );
); }
} foreach ($d->aliases as $alias) {
if ($d->valueAliases !== null) { $schema->addAlias(
$schema->addValueAliases( $alias->key,
$d->id->key, $d->id->key
$d->valueAliases );
); }
} if ($d->valueAliases !== null) {
} $schema->addValueAliases(
$schema->postProcess(); $d->id->key,
return $schema; $d->valueAliases
} );
}
} }
$schema->postProcess();
// vim: et sw=4 sts=4 return $schema;
}
}
// vim: et sw=4 sts=4
@@ -1,106 +1,144 @@
<?php <?php
/** /**
* Converts HTMLPurifier_ConfigSchema_Interchange to an XML format, * Converts HTMLPurifier_ConfigSchema_Interchange to an XML format,
* which can be further processed to generate documentation. * which can be further processed to generate documentation.
*/ */
class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter
{ {
protected $interchange; /**
private $namespace; * @type HTMLPurifier_ConfigSchema_Interchange
*/
protected function writeHTMLDiv($html) { protected $interchange;
$this->startElement('div');
/**
$purifier = HTMLPurifier::getInstance(); * @type string
$html = $purifier->purify($html); */
$this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); private $namespace;
$this->writeRaw($html);
/**
$this->endElement(); // div * @param string $html
} */
protected function writeHTMLDiv($html)
protected function export($var) { {
if ($var === array()) return 'array()'; $this->startElement('div');
return var_export($var, true);
} $purifier = HTMLPurifier::getInstance();
$html = $purifier->purify($html);
public function build($interchange) { $this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
// global access, only use as last resort $this->writeRaw($html);
$this->interchange = $interchange;
$this->endElement(); // div
$this->setIndent(true); }
$this->startDocument('1.0', 'UTF-8');
$this->startElement('configdoc'); /**
$this->writeElement('title', $interchange->name); * @param mixed $var
* @return string
foreach ($interchange->directives as $directive) { */
$this->buildDirective($directive); protected function export($var)
} {
if ($var === array()) {
if ($this->namespace) $this->endElement(); // namespace return 'array()';
}
$this->endElement(); // configdoc return var_export($var, true);
$this->flush(); }
}
/**
public function buildDirective($directive) { * @param HTMLPurifier_ConfigSchema_Interchange $interchange
*/
// Kludge, although I suppose having a notion of a "root namespace" public function build($interchange)
// certainly makes things look nicer when documentation is built. {
// Depends on things being sorted. // global access, only use as last resort
if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) { $this->interchange = $interchange;
if ($this->namespace) $this->endElement(); // namespace
$this->namespace = $directive->id->getRootNamespace(); $this->setIndent(true);
$this->startElement('namespace'); $this->startDocument('1.0', 'UTF-8');
$this->writeAttribute('id', $this->namespace); $this->startElement('configdoc');
$this->writeElement('name', $this->namespace); $this->writeElement('title', $interchange->name);
}
foreach ($interchange->directives as $directive) {
$this->startElement('directive'); $this->buildDirective($directive);
$this->writeAttribute('id', $directive->id->toString()); }
$this->writeElement('name', $directive->id->getDirective()); if ($this->namespace) {
$this->endElement();
$this->startElement('aliases'); } // namespace
foreach ($directive->aliases as $alias) $this->writeElement('alias', $alias->toString());
$this->endElement(); // aliases $this->endElement(); // configdoc
$this->flush();
$this->startElement('constraints'); }
if ($directive->version) $this->writeElement('version', $directive->version);
$this->startElement('type'); /**
if ($directive->typeAllowsNull) $this->writeAttribute('allow-null', 'yes'); * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive
$this->text($directive->type); */
$this->endElement(); // type public function buildDirective($directive)
if ($directive->allowed) { {
$this->startElement('allowed'); // Kludge, although I suppose having a notion of a "root namespace"
foreach ($directive->allowed as $value => $x) $this->writeElement('value', $value); // certainly makes things look nicer when documentation is built.
$this->endElement(); // allowed // Depends on things being sorted.
} if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) {
$this->writeElement('default', $this->export($directive->default)); if ($this->namespace) {
$this->writeAttribute('xml:space', 'preserve'); $this->endElement();
if ($directive->external) { } // namespace
$this->startElement('external'); $this->namespace = $directive->id->getRootNamespace();
foreach ($directive->external as $project) $this->writeElement('project', $project); $this->startElement('namespace');
$this->endElement(); $this->writeAttribute('id', $this->namespace);
} $this->writeElement('name', $this->namespace);
$this->endElement(); // constraints }
if ($directive->deprecatedVersion) { $this->startElement('directive');
$this->startElement('deprecated'); $this->writeAttribute('id', $directive->id->toString());
$this->writeElement('version', $directive->deprecatedVersion);
$this->writeElement('use', $directive->deprecatedUse->toString()); $this->writeElement('name', $directive->id->getDirective());
$this->endElement(); // deprecated
} $this->startElement('aliases');
foreach ($directive->aliases as $alias) {
$this->startElement('description'); $this->writeElement('alias', $alias->toString());
$this->writeHTMLDiv($directive->description); }
$this->endElement(); // description $this->endElement(); // aliases
$this->endElement(); // directive $this->startElement('constraints');
} if ($directive->version) {
$this->writeElement('version', $directive->version);
} }
$this->startElement('type');
// vim: et sw=4 sts=4 if ($directive->typeAllowsNull) {
$this->writeAttribute('allow-null', 'yes');
}
$this->text($directive->type);
$this->endElement(); // type
if ($directive->allowed) {
$this->startElement('allowed');
foreach ($directive->allowed as $value => $x) {
$this->writeElement('value', $value);
}
$this->endElement(); // allowed
}
$this->writeElement('default', $this->export($directive->default));
$this->writeAttribute('xml:space', 'preserve');
if ($directive->external) {
$this->startElement('external');
foreach ($directive->external as $project) {
$this->writeElement('project', $project);
}
$this->endElement();
}
$this->endElement(); // constraints
if ($directive->deprecatedVersion) {
$this->startElement('deprecated');
$this->writeElement('version', $directive->deprecatedVersion);
$this->writeElement('use', $directive->deprecatedUse->toString());
$this->endElement(); // deprecated
}
$this->startElement('description');
$this->writeHTMLDiv($directive->description);
$this->endElement(); // description
$this->endElement(); // directive
}
}
// vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Exceptions related to configuration schema * Exceptions related to configuration schema
*/ */
class HTMLPurifier_ConfigSchema_Exception extends HTMLPurifier_Exception class HTMLPurifier_ConfigSchema_Exception extends HTMLPurifier_Exception
{ {
} }
// vim: et sw=4 sts=4 // vim: et sw=4 sts=4
@@ -1,42 +1,47 @@
<?php <?php
/** /**
* Generic schema interchange format that can be converted to a runtime * Generic schema interchange format that can be converted to a runtime
* representation (HTMLPurifier_ConfigSchema) or HTML documentation. Members * representation (HTMLPurifier_ConfigSchema) or HTML documentation. Members
* are completely validated. * are completely validated.
*/ */
class HTMLPurifier_ConfigSchema_Interchange class HTMLPurifier_ConfigSchema_Interchange
{ {
/** /**
* Name of the application this schema is describing. * Name of the application this schema is describing.
*/ * @type string
public $name; */
public $name;
/**
* Array of Directive ID => array(directive info) /**
*/ * Array of Directive ID => array(directive info)
public $directives = array(); * @type HTMLPurifier_ConfigSchema_Interchange_Directive[]
*/
/** public $directives = array();
* Adds a directive array to $directives
*/ /**
public function addDirective($directive) { * Adds a directive array to $directives
if (isset($this->directives[$i = $directive->id->toString()])) { * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive
throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); * @throws HTMLPurifier_ConfigSchema_Exception
} */
$this->directives[$i] = $directive; public function addDirective($directive)
} {
if (isset($this->directives[$i = $directive->id->toString()])) {
/** throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'");
* Convenience function to perform standard validation. Throws exception }
* on failed validation. $this->directives[$i] = $directive;
*/ }
public function validate() {
$validator = new HTMLPurifier_ConfigSchema_Validator(); /**
return $validator->validate($this); * Convenience function to perform standard validation. Throws exception
} * on failed validation.
*/
} public function validate()
{
// vim: et sw=4 sts=4 $validator = new HTMLPurifier_ConfigSchema_Validator();
return $validator->validate($this);
}
}
// vim: et sw=4 sts=4
@@ -1,77 +1,89 @@
<?php <?php
/** /**
* Interchange component class describing configuration directives. * Interchange component class describing configuration directives.
*/ */
class HTMLPurifier_ConfigSchema_Interchange_Directive class HTMLPurifier_ConfigSchema_Interchange_Directive
{ {
/** /**
* ID of directive, instance of HTMLPurifier_ConfigSchema_Interchange_Id. * ID of directive.
*/ * @type HTMLPurifier_ConfigSchema_Interchange_Id
public $id; */
public $id;
/**
* String type, e.g. 'integer' or 'istring'. /**
*/ * Type, e.g. 'integer' or 'istring'.
public $type; * @type string
*/
/** public $type;
* Default value, e.g. 3 or 'DefaultVal'.
*/ /**
public $default; * Default value, e.g. 3 or 'DefaultVal'.
* @type mixed
/** */
* HTML description. public $default;
*/
public $description; /**
* HTML description.
/** * @type string
* Boolean whether or not null is allowed as a value. */
*/ public $description;
public $typeAllowsNull = false;
/**
/** * Whether or not null is allowed as a value.
* Lookup table of allowed scalar values, e.g. array('allowed' => true). * @type bool
* Null if all values are allowed. */
*/ public $typeAllowsNull = false;
public $allowed;
/**
/** * Lookup table of allowed scalar values.
* List of aliases for the directive, * e.g. array('allowed' => true).
* e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). * Null if all values are allowed.
*/ * @type array
public $aliases = array(); */
public $allowed;
/**
* Hash of value aliases, e.g. array('alt' => 'real'). Null if value /**
* aliasing is disabled (necessary for non-scalar types). * List of aliases for the directive.
*/ * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))).
public $valueAliases; * @type HTMLPurifier_ConfigSchema_Interchange_Id[]
*/
/** public $aliases = array();
* Version of HTML Purifier the directive was introduced, e.g. '1.3.1'.
* Null if the directive has always existed. /**
*/ * Hash of value aliases, e.g. array('alt' => 'real'). Null if value
public $version; * aliasing is disabled (necessary for non-scalar types).
* @type array
/** */
* ID of directive that supercedes this old directive, is an instance public $valueAliases;
* of HTMLPurifier_ConfigSchema_Interchange_Id. Null if not deprecated.
*/ /**
public $deprecatedUse; * Version of HTML Purifier the directive was introduced, e.g. '1.3.1'.
* Null if the directive has always existed.
/** * @type string
* Version of HTML Purifier this directive was deprecated. Null if not */
* deprecated. public $version;
*/
public $deprecatedVersion; /**
* ID of directive that supercedes this old directive.
/** * Null if not deprecated.
* List of external projects this directive depends on, e.g. array('CSSTidy'). * @type HTMLPurifier_ConfigSchema_Interchange_Id
*/ */
public $external = array(); public $deprecatedUse;
} /**
* Version of HTML Purifier this directive was deprecated. Null if not
// vim: et sw=4 sts=4 * deprecated.
* @type string
*/
public $deprecatedVersion;
/**
* List of external projects this directive depends on, e.g. array('CSSTidy').
* @type array
*/
public $external = array();
}
// vim: et sw=4 sts=4
@@ -1,37 +1,58 @@
<?php <?php
/** /**
* Represents a directive ID in the interchange format. * Represents a directive ID in the interchange format.
*/ */
class HTMLPurifier_ConfigSchema_Interchange_Id class HTMLPurifier_ConfigSchema_Interchange_Id
{ {
public $key; /**
* @type string
public function __construct($key) { */
$this->key = $key; public $key;
}
/**
/** * @param string $key
* @warning This is NOT magic, to ensure that people don't abuse SPL and */
* cause problems for PHP 5.0 support. public function __construct($key)
*/ {
public function toString() { $this->key = $key;
return $this->key; }
}
/**
public function getRootNamespace() { * @return string
return substr($this->key, 0, strpos($this->key, ".")); * @warning This is NOT magic, to ensure that people don't abuse SPL and
} * cause problems for PHP 5.0 support.
*/
public function getDirective() { public function toString()
return substr($this->key, strpos($this->key, ".") + 1); {
} return $this->key;
}
public static function make($id) {
return new HTMLPurifier_ConfigSchema_Interchange_Id($id); /**
} * @return string
*/
} public function getRootNamespace()
{
// vim: et sw=4 sts=4 return substr($this->key, 0, strpos($this->key, "."));
}
/**
* @return string
*/
public function getDirective()
{
return substr($this->key, strpos($this->key, ".") + 1);
}
/**
* @param string $id
* @return HTMLPurifier_ConfigSchema_Interchange_Id
*/
public static function make($id)
{
return new HTMLPurifier_ConfigSchema_Interchange_Id($id);
}
}
// vim: et sw=4 sts=4
@@ -1,180 +1,226 @@
<?php <?php
class HTMLPurifier_ConfigSchema_InterchangeBuilder class HTMLPurifier_ConfigSchema_InterchangeBuilder
{ {
/** /**
* Used for processing DEFAULT, nothing else. * Used for processing DEFAULT, nothing else.
*/ * @type HTMLPurifier_VarParser
protected $varParser; */
protected $varParser;
public function __construct($varParser = null) {
$this->varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native(); /**
} * @param HTMLPurifier_VarParser $varParser
*/
public static function buildFromDirectory($dir = null) { public function __construct($varParser = null)
$builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); {
$interchange = new HTMLPurifier_ConfigSchema_Interchange(); $this->varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native();
return $builder->buildDir($interchange, $dir); }
}
/**
public function buildDir($interchange, $dir = null) { * @param string $dir
if (!$dir) $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema'; * @return HTMLPurifier_ConfigSchema_Interchange
if (file_exists($dir . '/info.ini')) { */
$info = parse_ini_file($dir . '/info.ini'); public static function buildFromDirectory($dir = null)
$interchange->name = $info['name']; {
} $builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
$interchange = new HTMLPurifier_ConfigSchema_Interchange();
$files = array(); return $builder->buildDir($interchange, $dir);
$dh = opendir($dir); }
while (false !== ($file = readdir($dh))) {
if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') { /**
continue; * @param HTMLPurifier_ConfigSchema_Interchange $interchange
} * @param string $dir
$files[] = $file; * @return HTMLPurifier_ConfigSchema_Interchange
} */
closedir($dh); public function buildDir($interchange, $dir = null)
{
sort($files); if (!$dir) {
foreach ($files as $file) { $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema';
$this->buildFile($interchange, $dir . '/' . $file); }
} if (file_exists($dir . '/info.ini')) {
$info = parse_ini_file($dir . '/info.ini');
return $interchange; $interchange->name = $info['name'];
} }
public function buildFile($interchange, $file) { $files = array();
$parser = new HTMLPurifier_StringHashParser(); $dh = opendir($dir);
$this->build( while (false !== ($file = readdir($dh))) {
$interchange, if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') {
new HTMLPurifier_StringHash( $parser->parseFile($file) ) continue;
); }
} $files[] = $file;
}
/** closedir($dh);
* Builds an interchange object based on a hash.
* @param $interchange HTMLPurifier_ConfigSchema_Interchange object to build sort($files);
* @param $hash HTMLPurifier_ConfigSchema_StringHash source data foreach ($files as $file) {
*/ $this->buildFile($interchange, $dir . '/' . $file);
public function build($interchange, $hash) { }
if (!$hash instanceof HTMLPurifier_StringHash) { return $interchange;
$hash = new HTMLPurifier_StringHash($hash); }
}
if (!isset($hash['ID'])) { /**
throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID'); * @param HTMLPurifier_ConfigSchema_Interchange $interchange
} * @param string $file
if (strpos($hash['ID'], '.') === false) { */
if (count($hash) == 2 && isset($hash['DESCRIPTION'])) { public function buildFile($interchange, $file)
$hash->offsetGet('DESCRIPTION'); // prevent complaining {
} else { $parser = new HTMLPurifier_StringHashParser();
throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace'); $this->build(
} $interchange,
} else { new HTMLPurifier_StringHash($parser->parseFile($file))
$this->buildDirective($interchange, $hash); );
} }
$this->_findUnused($hash);
} /**
* Builds an interchange object based on a hash.
public function buildDirective($interchange, $hash) { * @param HTMLPurifier_ConfigSchema_Interchange $interchange HTMLPurifier_ConfigSchema_Interchange object to build
$directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); * @param HTMLPurifier_StringHash $hash source data
* @throws HTMLPurifier_ConfigSchema_Exception
// These are required elements: */
$directive->id = $this->id($hash->offsetGet('ID')); public function build($interchange, $hash)
$id = $directive->id->toString(); // convenience {
if (!$hash instanceof HTMLPurifier_StringHash) {
if (isset($hash['TYPE'])) { $hash = new HTMLPurifier_StringHash($hash);
$type = explode('/', $hash->offsetGet('TYPE')); }
if (isset($type[1])) $directive->typeAllowsNull = true; if (!isset($hash['ID'])) {
$directive->type = $type[0]; throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID');
} else { }
throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined"); if (strpos($hash['ID'], '.') === false) {
} if (count($hash) == 2 && isset($hash['DESCRIPTION'])) {
$hash->offsetGet('DESCRIPTION'); // prevent complaining
if (isset($hash['DEFAULT'])) { } else {
try { throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace');
$directive->default = $this->varParser->parse($hash->offsetGet('DEFAULT'), $directive->type, $directive->typeAllowsNull); }
} catch (HTMLPurifier_VarParserException $e) { } else {
throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'"); $this->buildDirective($interchange, $hash);
} }
} $this->_findUnused($hash);
}
if (isset($hash['DESCRIPTION'])) {
$directive->description = $hash->offsetGet('DESCRIPTION'); /**
} * @param HTMLPurifier_ConfigSchema_Interchange $interchange
* @param HTMLPurifier_StringHash $hash
if (isset($hash['ALLOWED'])) { * @throws HTMLPurifier_ConfigSchema_Exception
$directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED'))); */
} public function buildDirective($interchange, $hash)
{
if (isset($hash['VALUE-ALIASES'])) { $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive();
$directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES'));
} // These are required elements:
$directive->id = $this->id($hash->offsetGet('ID'));
if (isset($hash['ALIASES'])) { $id = $directive->id->toString(); // convenience
$raw_aliases = trim($hash->offsetGet('ALIASES'));
$aliases = preg_split('/\s*,\s*/', $raw_aliases); if (isset($hash['TYPE'])) {
foreach ($aliases as $alias) { $type = explode('/', $hash->offsetGet('TYPE'));
$directive->aliases[] = $this->id($alias); if (isset($type[1])) {
} $directive->typeAllowsNull = true;
} }
$directive->type = $type[0];
if (isset($hash['VERSION'])) { } else {
$directive->version = $hash->offsetGet('VERSION'); throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined");
} }
if (isset($hash['DEPRECATED-USE'])) { if (isset($hash['DEFAULT'])) {
$directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE')); try {
} $directive->default = $this->varParser->parse(
$hash->offsetGet('DEFAULT'),
if (isset($hash['DEPRECATED-VERSION'])) { $directive->type,
$directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION'); $directive->typeAllowsNull
} );
} catch (HTMLPurifier_VarParserException $e) {
if (isset($hash['EXTERNAL'])) { throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'");
$directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL'))); }
} }
$interchange->addDirective($directive); if (isset($hash['DESCRIPTION'])) {
} $directive->description = $hash->offsetGet('DESCRIPTION');
}
/**
* Evaluates an array PHP code string without array() wrapper if (isset($hash['ALLOWED'])) {
*/ $directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED')));
protected function evalArray($contents) { }
return eval('return array('. $contents .');');
} if (isset($hash['VALUE-ALIASES'])) {
$directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES'));
/** }
* Converts an array list into a lookup array.
*/ if (isset($hash['ALIASES'])) {
protected function lookup($array) { $raw_aliases = trim($hash->offsetGet('ALIASES'));
$ret = array(); $aliases = preg_split('/\s*,\s*/', $raw_aliases);
foreach ($array as $val) $ret[$val] = true; foreach ($aliases as $alias) {
return $ret; $directive->aliases[] = $this->id($alias);
} }
}
/**
* Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id if (isset($hash['VERSION'])) {
* object based on a string Id. $directive->version = $hash->offsetGet('VERSION');
*/ }
protected function id($id) {
return HTMLPurifier_ConfigSchema_Interchange_Id::make($id); if (isset($hash['DEPRECATED-USE'])) {
} $directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE'));
}
/**
* Triggers errors for any unused keys passed in the hash; such keys if (isset($hash['DEPRECATED-VERSION'])) {
* may indicate typos, missing values, etc. $directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION');
* @param $hash Instance of ConfigSchema_StringHash to check. }
*/
protected function _findUnused($hash) { if (isset($hash['EXTERNAL'])) {
$accessed = $hash->getAccessed(); $directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL')));
foreach ($hash as $k => $v) { }
if (!isset($accessed[$k])) {
trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE); $interchange->addDirective($directive);
} }
}
} /**
* Evaluates an array PHP code string without array() wrapper
} * @param string $contents
*/
// vim: et sw=4 sts=4 protected function evalArray($contents)
{
return eval('return array(' . $contents . ');');
}
/**
* Converts an array list into a lookup array.
* @param array $array
* @return array
*/
protected function lookup($array)
{
$ret = array();
foreach ($array as $val) {
$ret[$val] = true;
}
return $ret;
}
/**
* Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id
* object based on a string Id.
* @param string $id
* @return HTMLPurifier_ConfigSchema_Interchange_Id
*/
protected function id($id)
{
return HTMLPurifier_ConfigSchema_Interchange_Id::make($id);
}
/**
* Triggers errors for any unused keys passed in the hash; such keys
* may indicate typos, missing values, etc.
* @param HTMLPurifier_StringHash $hash Hash to check.
*/
protected function _findUnused($hash)
{
$accessed = $hash->getAccessed();
foreach ($hash as $k => $v) {
if (!isset($accessed[$k])) {
trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE);
}
}
}
}
// vim: et sw=4 sts=4
@@ -1,206 +1,248 @@
<?php <?php
/** /**
* Performs validations on HTMLPurifier_ConfigSchema_Interchange * Performs validations on HTMLPurifier_ConfigSchema_Interchange
* *
* @note If you see '// handled by InterchangeBuilder', that means a * @note If you see '// handled by InterchangeBuilder', that means a
* design decision in that class would prevent this validation from * design decision in that class would prevent this validation from
* ever being necessary. We have them anyway, however, for * ever being necessary. We have them anyway, however, for
* redundancy. * redundancy.
*/ */
class HTMLPurifier_ConfigSchema_Validator class HTMLPurifier_ConfigSchema_Validator
{ {
/** /**
* Easy to access global objects. * @type HTMLPurifier_ConfigSchema_Interchange
*/ */
protected $interchange, $aliases; protected $interchange;
/** /**
* Context-stack to provide easy to read error messages. * @type array
*/ */
protected $context = array(); protected $aliases;
/** /**
* HTMLPurifier_VarParser to test default's type. * Context-stack to provide easy to read error messages.
*/ * @type array
protected $parser; */
protected $context = array();
public function __construct() {
$this->parser = new HTMLPurifier_VarParser(); /**
} * to test default's type.
* @type HTMLPurifier_VarParser
/** */
* Validates a fully-formed interchange object. Throws an protected $parser;
* HTMLPurifier_ConfigSchema_Exception if there's a problem.
*/ public function __construct()
public function validate($interchange) { {
$this->interchange = $interchange; $this->parser = new HTMLPurifier_VarParser();
$this->aliases = array(); }
// PHP is a bit lax with integer <=> string conversions in
// arrays, so we don't use the identical !== comparison /**
foreach ($interchange->directives as $i => $directive) { * Validates a fully-formed interchange object.
$id = $directive->id->toString(); * @param HTMLPurifier_ConfigSchema_Interchange $interchange
if ($i != $id) $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'"); * @return bool
$this->validateDirective($directive); */
} public function validate($interchange)
return true; {
} $this->interchange = $interchange;
$this->aliases = array();
/** // PHP is a bit lax with integer <=> string conversions in
* Validates a HTMLPurifier_ConfigSchema_Interchange_Id object. // arrays, so we don't use the identical !== comparison
*/ foreach ($interchange->directives as $i => $directive) {
public function validateId($id) { $id = $directive->id->toString();
$id_string = $id->toString(); if ($i != $id) {
$this->context[] = "id '$id_string'"; $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'");
if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { }
// handled by InterchangeBuilder $this->validateDirective($directive);
$this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id'); }
} return true;
// keys are now unconstrained (we might want to narrow down to A-Za-z0-9.) }
// we probably should check that it has at least one namespace
$this->with($id, 'key') /**
->assertNotEmpty() * Validates a HTMLPurifier_ConfigSchema_Interchange_Id object.
->assertIsString(); // implicit assertIsString handled by InterchangeBuilder * @param HTMLPurifier_ConfigSchema_Interchange_Id $id
array_pop($this->context); */
} public function validateId($id)
{
/** $id_string = $id->toString();
* Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object. $this->context[] = "id '$id_string'";
*/ if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) {
public function validateDirective($d) { // handled by InterchangeBuilder
$id = $d->id->toString(); $this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id');
$this->context[] = "directive '$id'"; }
$this->validateId($d->id); // keys are now unconstrained (we might want to narrow down to A-Za-z0-9.)
// we probably should check that it has at least one namespace
$this->with($d, 'description') $this->with($id, 'key')
->assertNotEmpty(); ->assertNotEmpty()
->assertIsString(); // implicit assertIsString handled by InterchangeBuilder
// BEGIN - handled by InterchangeBuilder array_pop($this->context);
$this->with($d, 'type') }
->assertNotEmpty();
$this->with($d, 'typeAllowsNull') /**
->assertIsBool(); * Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object.
try { * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
// This also tests validity of $d->type */
$this->parser->parse($d->default, $d->type, $d->typeAllowsNull); public function validateDirective($d)
} catch (HTMLPurifier_VarParserException $e) { {
$this->error('default', 'had error: ' . $e->getMessage()); $id = $d->id->toString();
} $this->context[] = "directive '$id'";
// END - handled by InterchangeBuilder $this->validateId($d->id);
if (!is_null($d->allowed) || !empty($d->valueAliases)) { $this->with($d, 'description')
// allowed and valueAliases require that we be dealing with ->assertNotEmpty();
// strings, so check for that early.
$d_int = HTMLPurifier_VarParser::$types[$d->type]; // BEGIN - handled by InterchangeBuilder
if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) { $this->with($d, 'type')
$this->error('type', 'must be a string type when used with allowed or value aliases'); ->assertNotEmpty();
} $this->with($d, 'typeAllowsNull')
} ->assertIsBool();
try {
$this->validateDirectiveAllowed($d); // This also tests validity of $d->type
$this->validateDirectiveValueAliases($d); $this->parser->parse($d->default, $d->type, $d->typeAllowsNull);
$this->validateDirectiveAliases($d); } catch (HTMLPurifier_VarParserException $e) {
$this->error('default', 'had error: ' . $e->getMessage());
array_pop($this->context); }
} // END - handled by InterchangeBuilder
/** if (!is_null($d->allowed) || !empty($d->valueAliases)) {
* Extra validation if $allowed member variable of // allowed and valueAliases require that we be dealing with
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined. // strings, so check for that early.
*/ $d_int = HTMLPurifier_VarParser::$types[$d->type];
public function validateDirectiveAllowed($d) { if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) {
if (is_null($d->allowed)) return; $this->error('type', 'must be a string type when used with allowed or value aliases');
$this->with($d, 'allowed') }
->assertNotEmpty() }
->assertIsLookup(); // handled by InterchangeBuilder
if (is_string($d->default) && !isset($d->allowed[$d->default])) { $this->validateDirectiveAllowed($d);
$this->error('default', 'must be an allowed value'); $this->validateDirectiveValueAliases($d);
} $this->validateDirectiveAliases($d);
$this->context[] = 'allowed';
foreach ($d->allowed as $val => $x) { array_pop($this->context);
if (!is_string($val)) $this->error("value $val", 'must be a string'); }
}
array_pop($this->context); /**
} * Extra validation if $allowed member variable of
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
/** * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
* Extra validation if $valueAliases member variable of */
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined. public function validateDirectiveAllowed($d)
*/ {
public function validateDirectiveValueAliases($d) { if (is_null($d->allowed)) {
if (is_null($d->valueAliases)) return; return;
$this->with($d, 'valueAliases') }
->assertIsArray(); // handled by InterchangeBuilder $this->with($d, 'allowed')
$this->context[] = 'valueAliases'; ->assertNotEmpty()
foreach ($d->valueAliases as $alias => $real) { ->assertIsLookup(); // handled by InterchangeBuilder
if (!is_string($alias)) $this->error("alias $alias", 'must be a string'); if (is_string($d->default) && !isset($d->allowed[$d->default])) {
if (!is_string($real)) $this->error("alias target $real from alias '$alias'", 'must be a string'); $this->error('default', 'must be an allowed value');
if ($alias === $real) { }
$this->error("alias '$alias'", "must not be an alias to itself"); $this->context[] = 'allowed';
} foreach ($d->allowed as $val => $x) {
} if (!is_string($val)) {
if (!is_null($d->allowed)) { $this->error("value $val", 'must be a string');
foreach ($d->valueAliases as $alias => $real) { }
if (isset($d->allowed[$alias])) { }
$this->error("alias '$alias'", 'must not be an allowed value'); array_pop($this->context);
} elseif (!isset($d->allowed[$real])) { }
$this->error("alias '$alias'", 'must be an alias to an allowed value');
} /**
} * Extra validation if $valueAliases member variable of
} * HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
array_pop($this->context); * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
} */
public function validateDirectiveValueAliases($d)
/** {
* Extra validation if $aliases member variable of if (is_null($d->valueAliases)) {
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined. return;
*/ }
public function validateDirectiveAliases($d) { $this->with($d, 'valueAliases')
$this->with($d, 'aliases') ->assertIsArray(); // handled by InterchangeBuilder
->assertIsArray(); // handled by InterchangeBuilder $this->context[] = 'valueAliases';
$this->context[] = 'aliases'; foreach ($d->valueAliases as $alias => $real) {
foreach ($d->aliases as $alias) { if (!is_string($alias)) {
$this->validateId($alias); $this->error("alias $alias", 'must be a string');
$s = $alias->toString(); }
if (isset($this->interchange->directives[$s])) { if (!is_string($real)) {
$this->error("alias '$s'", 'collides with another directive'); $this->error("alias target $real from alias '$alias'", 'must be a string');
} }
if (isset($this->aliases[$s])) { if ($alias === $real) {
$other_directive = $this->aliases[$s]; $this->error("alias '$alias'", "must not be an alias to itself");
$this->error("alias '$s'", "collides with alias for directive '$other_directive'"); }
} }
$this->aliases[$s] = $d->id->toString(); if (!is_null($d->allowed)) {
} foreach ($d->valueAliases as $alias => $real) {
array_pop($this->context); if (isset($d->allowed[$alias])) {
} $this->error("alias '$alias'", 'must not be an allowed value');
} elseif (!isset($d->allowed[$real])) {
// protected helper functions $this->error("alias '$alias'", 'must be an alias to an allowed value');
}
/** }
* Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom }
* for validating simple member variables of objects. array_pop($this->context);
*/ }
protected function with($obj, $member) {
return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member); /**
} * Extra validation if $aliases member variable of
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
/** * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
* Emits an error, providing helpful context. */
*/ public function validateDirectiveAliases($d)
protected function error($target, $msg) { {
if ($target !== false) $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); $this->with($d, 'aliases')
else $prefix = ucfirst($this->getFormattedContext()); ->assertIsArray(); // handled by InterchangeBuilder
throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg)); $this->context[] = 'aliases';
} foreach ($d->aliases as $alias) {
$this->validateId($alias);
/** $s = $alias->toString();
* Returns a formatted context string. if (isset($this->interchange->directives[$s])) {
*/ $this->error("alias '$s'", 'collides with another directive');
protected function getFormattedContext() { }
return implode(' in ', array_reverse($this->context)); if (isset($this->aliases[$s])) {
} $other_directive = $this->aliases[$s];
$this->error("alias '$s'", "collides with alias for directive '$other_directive'");
} }
$this->aliases[$s] = $d->id->toString();
// vim: et sw=4 sts=4 }
array_pop($this->context);
}
// protected helper functions
/**
* Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom
* for validating simple member variables of objects.
* @param $obj
* @param $member
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
*/
protected function with($obj, $member)
{
return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member);
}
/**
* Emits an error, providing helpful context.
* @throws HTMLPurifier_ConfigSchema_Exception
*/
protected function error($target, $msg)
{
if ($target !== false) {
$prefix = ucfirst($target) . ' in ' . $this->getFormattedContext();
} else {
$prefix = ucfirst($this->getFormattedContext());
}
throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg));
}
/**
* Returns a formatted context string.
* @return string
*/
protected function getFormattedContext()
{
return implode(' in ', array_reverse($this->context));
}
}
// vim: et sw=4 sts=4
@@ -1,66 +1,130 @@
<?php <?php
/** /**
* Fluent interface for validating the contents of member variables. * Fluent interface for validating the contents of member variables.
* This should be immutable. See HTMLPurifier_ConfigSchema_Validator for * This should be immutable. See HTMLPurifier_ConfigSchema_Validator for
* use-cases. We name this an 'atom' because it's ONLY for validations that * use-cases. We name this an 'atom' because it's ONLY for validations that
* are independent and usually scalar. * are independent and usually scalar.
*/ */
class HTMLPurifier_ConfigSchema_ValidatorAtom class HTMLPurifier_ConfigSchema_ValidatorAtom
{ {
/**
protected $context, $obj, $member, $contents; * @type string
*/
public function __construct($context, $obj, $member) { protected $context;
$this->context = $context;
$this->obj = $obj; /**
$this->member = $member; * @type object
$this->contents =& $obj->$member; */
} protected $obj;
public function assertIsString() { /**
if (!is_string($this->contents)) $this->error('must be a string'); * @type string
return $this; */
} protected $member;
public function assertIsBool() { /**
if (!is_bool($this->contents)) $this->error('must be a boolean'); * @type mixed
return $this; */
} protected $contents;
public function assertIsArray() { public function __construct($context, $obj, $member)
if (!is_array($this->contents)) $this->error('must be an array'); {
return $this; $this->context = $context;
} $this->obj = $obj;
$this->member = $member;
public function assertNotNull() { $this->contents =& $obj->$member;
if ($this->contents === null) $this->error('must not be null'); }
return $this;
} /**
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
public function assertAlnum() { */
$this->assertIsString(); public function assertIsString()
if (!ctype_alnum($this->contents)) $this->error('must be alphanumeric'); {
return $this; if (!is_string($this->contents)) {
} $this->error('must be a string');
}
public function assertNotEmpty() { return $this;
if (empty($this->contents)) $this->error('must not be empty'); }
return $this;
} /**
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
public function assertIsLookup() { */
$this->assertIsArray(); public function assertIsBool()
foreach ($this->contents as $v) { {
if ($v !== true) $this->error('must be a lookup array'); if (!is_bool($this->contents)) {
} $this->error('must be a boolean');
return $this; }
} return $this;
}
protected function error($msg) {
throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg); /**
} * @return HTMLPurifier_ConfigSchema_ValidatorAtom
*/
} public function assertIsArray()
{
// vim: et sw=4 sts=4 if (!is_array($this->contents)) {
$this->error('must be an array');
}
return $this;
}
/**
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
*/
public function assertNotNull()
{
if ($this->contents === null) {
$this->error('must not be null');
}
return $this;
}
/**
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
*/
public function assertAlnum()
{
$this->assertIsString();
if (!ctype_alnum($this->contents)) {
$this->error('must be alphanumeric');
}
return $this;
}
/**
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
*/
public function assertNotEmpty()
{
if (empty($this->contents)) {
$this->error('must not be empty');
}
return $this;
}
/**
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
*/
public function assertIsLookup()
{
$this->assertIsArray();
foreach ($this->contents as $v) {
if ($v !== true) {
$this->error('must be a lookup array');
}
}
return $this;
}
/**
* @param string $msg
* @throws HTMLPurifier_ConfigSchema_Exception
*/
protected function error($msg)
{
throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg);
}
}
// vim: et sw=4 sts=4
@@ -1,8 +1,8 @@
Attr.AllowedClasses Attr.AllowedClasses
TYPE: lookup/null TYPE: lookup/null
VERSION: 4.0.0 VERSION: 4.0.0
DEFAULT: null DEFAULT: null
--DESCRIPTION-- --DESCRIPTION--
List of allowed class values in the class attribute. By default, this is null, List of allowed class values in the class attribute. By default, this is null,
which means all classes are allowed. which means all classes are allowed.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
Attr.AllowedFrameTargets Attr.AllowedFrameTargets
TYPE: lookup TYPE: lookup
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
Lookup table of all allowed link frame targets. Some commonly used link Lookup table of all allowed link frame targets. Some commonly used link
targets include _blank, _self, _parent and _top. Values should be targets include _blank, _self, _parent and _top. Values should be
lowercase, as validation will be done in a case-sensitive manner despite lowercase, as validation will be done in a case-sensitive manner despite
W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute
so this directive will have no effect in that doctype. XHTML 1.1 does not so this directive will have no effect in that doctype. XHTML 1.1 does not
enable the Target module by default, you will have to manually enable it enable the Target module by default, you will have to manually enable it
(see the module documentation for more details.) (see the module documentation for more details.)
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,9 +1,9 @@
Attr.AllowedRel Attr.AllowedRel
TYPE: lookup TYPE: lookup
VERSION: 1.6.0 VERSION: 1.6.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
List of allowed forward document relationships in the rel attribute. Common List of allowed forward document relationships in the rel attribute. Common
values may be nofollow or print. By default, this is empty, meaning that no values may be nofollow or print. By default, this is empty, meaning that no
document relationships are allowed. document relationships are allowed.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,9 +1,9 @@
Attr.AllowedRev Attr.AllowedRev
TYPE: lookup TYPE: lookup
VERSION: 1.6.0 VERSION: 1.6.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
List of allowed reverse document relationships in the rev attribute. This List of allowed reverse document relationships in the rev attribute. This
attribute is a bit of an edge-case; if you don't know what it is for, stay attribute is a bit of an edge-case; if you don't know what it is for, stay
away. away.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,19 +1,19 @@
Attr.ClassUseCDATA Attr.ClassUseCDATA
TYPE: bool/null TYPE: bool/null
DEFAULT: null DEFAULT: null
VERSION: 4.0.0 VERSION: 4.0.0
--DESCRIPTION-- --DESCRIPTION--
If null, class will auto-detect the doctype and, if matching XHTML 1.1 or If null, class will auto-detect the doctype and, if matching XHTML 1.1 or
XHTML 2.0, will use the restrictive NMTOKENS specification of class. Otherwise, XHTML 2.0, will use the restrictive NMTOKENS specification of class. Otherwise,
it will use a relaxed CDATA definition. If true, the relaxed CDATA definition it will use a relaxed CDATA definition. If true, the relaxed CDATA definition
is forced; if false, the NMTOKENS definition is forced. To get behavior is forced; if false, the NMTOKENS definition is forced. To get behavior
of HTML Purifier prior to 4.0.0, set this directive to false. of HTML Purifier prior to 4.0.0, set this directive to false.
Some rational behind the auto-detection: Some rational behind the auto-detection:
in previous versions of HTML Purifier, it was assumed that the form of in previous versions of HTML Purifier, it was assumed that the form of
class was NMTOKENS, as specified by the XHTML Modularization (representing class was NMTOKENS, as specified by the XHTML Modularization (representing
XHTML 1.1 and XHTML 2.0). The DTDs for HTML 4.01 and XHTML 1.0, however XHTML 1.1 and XHTML 2.0). The DTDs for HTML 4.01 and XHTML 1.0, however
specify class as CDATA. HTML 5 effectively defines it as CDATA, but specify class as CDATA. HTML 5 effectively defines it as CDATA, but
with the additional constraint that each name should be unique (this is not with the additional constraint that each name should be unique (this is not
explicitly outlined in previous specifications). explicitly outlined in previous specifications).
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
Attr.DefaultImageAlt Attr.DefaultImageAlt
TYPE: string/null TYPE: string/null
DEFAULT: null DEFAULT: null
VERSION: 3.2.0 VERSION: 3.2.0
--DESCRIPTION-- --DESCRIPTION--
This is the content of the alt tag of an image if the user had not This is the content of the alt tag of an image if the user had not
previously specified an alt attribute. This applies to all images without previously specified an alt attribute. This applies to all images without
a valid alt attribute, as opposed to %Attr.DefaultInvalidImageAlt, which a valid alt attribute, as opposed to %Attr.DefaultInvalidImageAlt, which
only applies to invalid images, and overrides in the case of an invalid image. only applies to invalid images, and overrides in the case of an invalid image.
Default behavior with null is to use the basename of the src tag for the alt. Default behavior with null is to use the basename of the src tag for the alt.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,9 +1,9 @@
Attr.DefaultInvalidImage Attr.DefaultInvalidImage
TYPE: string TYPE: string
DEFAULT: '' DEFAULT: ''
--DESCRIPTION-- --DESCRIPTION--
This is the default image an img tag will be pointed to if it does not have This is the default image an img tag will be pointed to if it does not have
a valid src attribute. In future versions, we may allow the image tag to a valid src attribute. In future versions, we may allow the image tag to
be removed completely, but due to design issues, this is not possible right be removed completely, but due to design issues, this is not possible right
now. now.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,8 +1,8 @@
Attr.DefaultInvalidImageAlt Attr.DefaultInvalidImageAlt
TYPE: string TYPE: string
DEFAULT: 'Invalid image' DEFAULT: 'Invalid image'
--DESCRIPTION-- --DESCRIPTION--
This is the content of the alt tag of an invalid image if the user had not This is the content of the alt tag of an invalid image if the user had not
previously specified an alt attribute. It has no effect when the image is previously specified an alt attribute. It has no effect when the image is
valid but there was no alt attribute present. valid but there was no alt attribute present.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,10 +1,10 @@
Attr.DefaultTextDir Attr.DefaultTextDir
TYPE: string TYPE: string
DEFAULT: 'ltr' DEFAULT: 'ltr'
--DESCRIPTION-- --DESCRIPTION--
Defines the default text direction (ltr or rtl) of the document being Defines the default text direction (ltr or rtl) of the document being
parsed. This generally is the same as the value of the dir attribute in parsed. This generally is the same as the value of the dir attribute in
HTML, or ltr if that is not specified. HTML, or ltr if that is not specified.
--ALLOWED-- --ALLOWED--
'ltr', 'rtl' 'ltr', 'rtl'
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,16 +1,16 @@
Attr.EnableID Attr.EnableID
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 1.2.0 VERSION: 1.2.0
--DESCRIPTION-- --DESCRIPTION--
Allows the ID attribute in HTML. This is disabled by default due to the Allows the ID attribute in HTML. This is disabled by default due to the
fact that without proper configuration user input can easily break the fact that without proper configuration user input can easily break the
validation of a webpage by specifying an ID that is already on the validation of a webpage by specifying an ID that is already on the
surrounding HTML. If you don't mind throwing caution to the wind, enable surrounding HTML. If you don't mind throwing caution to the wind, enable
this directive, but I strongly recommend you also consider blacklisting IDs this directive, but I strongly recommend you also consider blacklisting IDs
you use (%Attr.IDBlacklist) or prefixing all user supplied IDs you use (%Attr.IDBlacklist) or prefixing all user supplied IDs
(%Attr.IDPrefix). When set to true HTML Purifier reverts to the behavior of (%Attr.IDPrefix). When set to true HTML Purifier reverts to the behavior of
pre-1.2.0 versions. pre-1.2.0 versions.
--ALIASES-- --ALIASES--
HTML.EnableAttrID HTML.EnableAttrID
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,8 +1,8 @@
Attr.ForbiddenClasses Attr.ForbiddenClasses
TYPE: lookup TYPE: lookup
VERSION: 4.0.0 VERSION: 4.0.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
List of forbidden class values in the class attribute. By default, this is List of forbidden class values in the class attribute. By default, this is
empty, which means that no classes are forbidden. See also %Attr.AllowedClasses. empty, which means that no classes are forbidden. See also %Attr.AllowedClasses.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,5 +1,5 @@
Attr.IDBlacklist Attr.IDBlacklist
TYPE: list TYPE: list
DEFAULT: array() DEFAULT: array()
DESCRIPTION: Array of IDs not allowed in the document. DESCRIPTION: Array of IDs not allowed in the document.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,9 +1,9 @@
Attr.IDBlacklistRegexp Attr.IDBlacklistRegexp
TYPE: string/null TYPE: string/null
VERSION: 1.6.0 VERSION: 1.6.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
PCRE regular expression to be matched against all IDs. If the expression is PCRE regular expression to be matched against all IDs. If the expression is
matches, the ID is rejected. Use this with care: may cause significant matches, the ID is rejected. Use this with care: may cause significant
degradation. ID matching is done after all other validation. degradation. ID matching is done after all other validation.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
Attr.IDPrefix Attr.IDPrefix
TYPE: string TYPE: string
VERSION: 1.2.0 VERSION: 1.2.0
DEFAULT: '' DEFAULT: ''
--DESCRIPTION-- --DESCRIPTION--
String to prefix to IDs. If you have no idea what IDs your pages may use, String to prefix to IDs. If you have no idea what IDs your pages may use,
you may opt to simply add a prefix to all user-submitted ID attributes so you may opt to simply add a prefix to all user-submitted ID attributes so
that they are still usable, but will not conflict with core page IDs. that they are still usable, but will not conflict with core page IDs.
Example: setting the directive to 'user_' will result in a user submitted Example: setting the directive to 'user_' will result in a user submitted
'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true 'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true
before using this. before using this.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,14 +1,14 @@
Attr.IDPrefixLocal Attr.IDPrefixLocal
TYPE: string TYPE: string
VERSION: 1.2.0 VERSION: 1.2.0
DEFAULT: '' DEFAULT: ''
--DESCRIPTION-- --DESCRIPTION--
Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you
need to allow multiple sets of user content on web page, you may need to need to allow multiple sets of user content on web page, you may need to
have a seperate prefix that changes with each iteration. This way, have a seperate prefix that changes with each iteration. This way,
seperately submitted user content displayed on the same page doesn't seperately submitted user content displayed on the same page doesn't
clobber each other. Ideal values are unique identifiers for the content it clobber each other. Ideal values are unique identifiers for the content it
represents (i.e. the id of the row in the database). Be sure to add a represents (i.e. the id of the row in the database). Be sure to add a
seperator (like an underscore) at the end. Warning: this directive will seperator (like an underscore) at the end. Warning: this directive will
not work unless %Attr.IDPrefix is set to a non-empty value! not work unless %Attr.IDPrefix is set to a non-empty value!
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,31 +1,31 @@
AutoFormat.AutoParagraph AutoFormat.AutoParagraph
TYPE: bool TYPE: bool
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive turns on auto-paragraphing, where double newlines are This directive turns on auto-paragraphing, where double newlines are
converted in to paragraphs whenever possible. Auto-paragraphing: converted in to paragraphs whenever possible. Auto-paragraphing:
</p> </p>
<ul> <ul>
<li>Always applies to inline elements or text in the root node,</li> <li>Always applies to inline elements or text in the root node,</li>
<li>Applies to inline elements or text with double newlines in nodes <li>Applies to inline elements or text with double newlines in nodes
that allow paragraph tags,</li> that allow paragraph tags,</li>
<li>Applies to double newlines in paragraph tags</li> <li>Applies to double newlines in paragraph tags</li>
</ul> </ul>
<p> <p>
<code>p</code> tags must be allowed for this directive to take effect. <code>p</code> tags must be allowed for this directive to take effect.
We do not use <code>br</code> tags for paragraphing, as that is We do not use <code>br</code> tags for paragraphing, as that is
semantically incorrect. semantically incorrect.
</p> </p>
<p> <p>
To prevent auto-paragraphing as a content-producer, refrain from using To prevent auto-paragraphing as a content-producer, refrain from using
double-newlines except to specify a new paragraph or in contexts where double-newlines except to specify a new paragraph or in contexts where
it has special meaning (whitespace usually has no meaning except in it has special meaning (whitespace usually has no meaning except in
tags like <code>pre</code>, so this should not be difficult.) To prevent tags like <code>pre</code>, so this should not be difficult.) To prevent
the paragraphing of inline text adjacent to block elements, wrap them the paragraphing of inline text adjacent to block elements, wrap them
in <code>div</code> tags (the behavior is slightly different outside of in <code>div</code> tags (the behavior is slightly different outside of
the root node.) the root node.)
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
AutoFormat.Custom AutoFormat.Custom
TYPE: list TYPE: list
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive can be used to add custom auto-format injectors. This directive can be used to add custom auto-format injectors.
Specify an array of injector names (class name minus the prefix) Specify an array of injector names (class name minus the prefix)
or concrete implementations. Injector class must exist. or concrete implementations. Injector class must exist.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
AutoFormat.DisplayLinkURI AutoFormat.DisplayLinkURI
TYPE: bool TYPE: bool
VERSION: 3.2.0 VERSION: 3.2.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive turns on the in-text display of URIs in &lt;a&gt; tags, and disables This directive turns on the in-text display of URIs in &lt;a&gt; tags, and disables
those links. For example, <a href="http://example.com">example</a> becomes those links. For example, <a href="http://example.com">example</a> becomes
example (<a>http://example.com</a>). example (<a>http://example.com</a>).
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
AutoFormat.Linkify AutoFormat.Linkify
TYPE: bool TYPE: bool
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive turns on linkification, auto-linking http, ftp and This directive turns on linkification, auto-linking http, ftp and
https URLs. <code>a</code> tags with the <code>href</code> attribute https URLs. <code>a</code> tags with the <code>href</code> attribute
must be allowed. must be allowed.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
AutoFormat.PurifierLinkify.DocURL AutoFormat.PurifierLinkify.DocURL
TYPE: string TYPE: string
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: '#%s' DEFAULT: '#%s'
ALIASES: AutoFormatParam.PurifierLinkifyDocURL ALIASES: AutoFormatParam.PurifierLinkifyDocURL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Location of configuration documentation to link to, let %s substitute Location of configuration documentation to link to, let %s substitute
into the configuration's namespace and directive names sans the percent into the configuration's namespace and directive names sans the percent
sign. sign.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
AutoFormat.PurifierLinkify AutoFormat.PurifierLinkify
TYPE: bool TYPE: bool
VERSION: 2.0.1 VERSION: 2.0.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Internal auto-formatter that converts configuration directives in Internal auto-formatter that converts configuration directives in
syntax <a>%Namespace.Directive</a> to links. <code>a</code> tags syntax <a>%Namespace.Directive</a> to links. <code>a</code> tags
with the <code>href</code> attribute must be allowed. with the <code>href</code> attribute must be allowed.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -0,0 +1,14 @@
AutoFormat.RemoveEmpty.Predicate
TYPE: hash
VERSION: 4.7.0
DEFAULT: array('colgroup' => array(), 'th' => array(), 'td' => array(), 'iframe' => array('src'))
--DESCRIPTION--
<p>
Given that an element has no contents, it will be removed by default, unless
this predicate dictates otherwise. The predicate can either be an associative
map from tag name to list of attributes that must be present for the element
to be considered preserved: thus, the default always preserves <code>colgroup</code>,
<code>th</code> and <code>td</code>, and also <code>iframe</code> if it
has a <code>src</code>.
</p>
--# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions
TYPE: lookup TYPE: lookup
VERSION: 4.0.0 VERSION: 4.0.0
DEFAULT: array('td' => true, 'th' => true) DEFAULT: array('td' => true, 'th' => true)
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
When %AutoFormat.RemoveEmpty and %AutoFormat.RemoveEmpty.RemoveNbsp When %AutoFormat.RemoveEmpty and %AutoFormat.RemoveEmpty.RemoveNbsp
are enabled, this directive defines what HTML elements should not be are enabled, this directive defines what HTML elements should not be
removede if they have only a non-breaking space in them. removede if they have only a non-breaking space in them.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,15 +1,15 @@
AutoFormat.RemoveEmpty.RemoveNbsp AutoFormat.RemoveEmpty.RemoveNbsp
TYPE: bool TYPE: bool
VERSION: 4.0.0 VERSION: 4.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
When enabled, HTML Purifier will treat any elements that contain only When enabled, HTML Purifier will treat any elements that contain only
non-breaking spaces as well as regular whitespace as empty, and remove non-breaking spaces as well as regular whitespace as empty, and remove
them when %AutoForamt.RemoveEmpty is enabled. them when %AutoForamt.RemoveEmpty is enabled.
</p> </p>
<p> <p>
See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements
that don't have this behavior applied to them. that don't have this behavior applied to them.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4

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