Compare commits

...
21 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
193 changed files with 33253 additions and 25578 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');
?> ?>
+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";
+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}
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
@@ -244,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
@@ -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'];
+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');
+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
@@ -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'];
+7 -1
View File
@@ -5,7 +5,7 @@
********************/ ********************/
define('G5_VERSION', '그누보드5'); define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.1.3'); define('G5_GNUBOARD_VER', '5.1.7');
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음 // 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
define('_GNUBOARD_', true); define('_GNUBOARD_', true);
@@ -198,6 +198,12 @@ define('G5_IS_MOBILE_DHTML_USE', false);
// MySQLi 사용여부를 설정합니다. // MySQLi 사용여부를 설정합니다.
define('G5_MYSQLI_USE', true); 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}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

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);
+15 -3
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'));
@@ -1453,7 +1454,7 @@ function sql_set_charset($charset, $link=null)
if(function_exists('mysqli_set_charset') && G5_MYSQLI_USE) if(function_exists('mysqli_set_charset') && G5_MYSQLI_USE)
mysqli_set_charset($link, $charset); mysqli_set_charset($link, $charset);
else else
sql_query(" set names {$charset} "); mysql_query(" set names {$charset} ", $link);
} }
@@ -2913,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)
{ {
+1 -1
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')
+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
@@ -1,46 +1,46 @@
AutoFormat.RemoveEmpty AutoFormat.RemoveEmpty
TYPE: bool TYPE: bool
VERSION: 3.2.0 VERSION: 3.2.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
When enabled, HTML Purifier will attempt to remove empty elements that When enabled, HTML Purifier will attempt to remove empty elements that
contribute no semantic information to the document. The following types contribute no semantic information to the document. The following types
of nodes will be removed: of nodes will be removed:
</p> </p>
<ul><li> <ul><li>
Tags with no attributes and no content, and that are not empty Tags with no attributes and no content, and that are not empty
elements (remove <code>&lt;a&gt;&lt;/a&gt;</code> but not elements (remove <code>&lt;a&gt;&lt;/a&gt;</code> but not
<code>&lt;br /&gt;</code>), and <code>&lt;br /&gt;</code>), and
</li> </li>
<li> <li>
Tags with no content, except for:<ul> Tags with no content, except for:<ul>
<li>The <code>colgroup</code> element, or</li> <li>The <code>colgroup</code> element, or</li>
<li> <li>
Elements with the <code>id</code> or <code>name</code> attribute, Elements with the <code>id</code> or <code>name</code> attribute,
when those attributes are permitted on those elements. when those attributes are permitted on those elements.
</li> </li>
</ul></li> </ul></li>
</ul> </ul>
<p> <p>
Please be very careful when using this functionality; while it may not Please be very careful when using this functionality; while it may not
seem that empty elements contain useful information, they can alter the seem that empty elements contain useful information, they can alter the
layout of a document given appropriate styling. This directive is most layout of a document given appropriate styling. This directive is most
useful when you are processing machine-generated HTML, please avoid using useful when you are processing machine-generated HTML, please avoid using
it on regular user HTML. it on regular user HTML.
</p> </p>
<p> <p>
Elements that contain only whitespace will be treated as empty. Non-breaking Elements that contain only whitespace will be treated as empty. Non-breaking
spaces, however, do not count as whitespace. See spaces, however, do not count as whitespace. See
%AutoFormat.RemoveEmpty.RemoveNbsp for alternate behavior. %AutoFormat.RemoveEmpty.RemoveNbsp for alternate behavior.
</p> </p>
<p> <p>
This algorithm is not perfect; you may still notice some empty tags, This algorithm is not perfect; you may still notice some empty tags,
particularly if a node had elements, but those elements were later removed particularly if a node had elements, but those elements were later removed
because they were not permitted in that context, or tags that, after because they were not permitted in that context, or tags that, after
being auto-closed by another tag, where empty. This is for safety reasons being auto-closed by another tag, where empty. This is for safety reasons
to prevent clever code from breaking validation. The general rule of thumb: to prevent clever code from breaking validation. The general rule of thumb:
if a tag looked empty on the way in, it will get removed; if HTML Purifier if a tag looked empty on the way in, it will get removed; if HTML Purifier
made it empty, it will stay. made it empty, it will stay.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
AutoFormat.RemoveSpansWithoutAttributes AutoFormat.RemoveSpansWithoutAttributes
TYPE: bool TYPE: bool
VERSION: 4.0.1 VERSION: 4.0.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive causes <code>span</code> tags without any attributes This directive causes <code>span</code> tags without any attributes
to be removed. It will also remove spans that had all attributes to be removed. It will also remove spans that had all attributes
removed during processing. removed during processing.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,8 +1,8 @@
CSS.AllowImportant CSS.AllowImportant
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 3.1.0 VERSION: 3.1.0
--DESCRIPTION-- --DESCRIPTION--
This parameter determines whether or not !important cascade modifiers should This parameter determines whether or not !important cascade modifiers should
be allowed in user CSS. If false, !important will stripped. be allowed in user CSS. If false, !important will stripped.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
CSS.AllowTricky CSS.AllowTricky
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 3.1.0 VERSION: 3.1.0
--DESCRIPTION-- --DESCRIPTION--
This parameter determines whether or not to allow "tricky" CSS properties and This parameter determines whether or not to allow "tricky" CSS properties and
values. Tricky CSS properties/values can drastically modify page layout or values. Tricky CSS properties/values can drastically modify page layout or
be used for deceptive practices but do not directly constitute a security risk. be used for deceptive practices but do not directly constitute a security risk.
For example, <code>display:none;</code> is considered a tricky property that For example, <code>display:none;</code> is considered a tricky property that
will only be allowed if this directive is set to true. will only be allowed if this directive is set to true.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
CSS.AllowedFonts CSS.AllowedFonts
TYPE: lookup/null TYPE: lookup/null
VERSION: 4.3.0 VERSION: 4.3.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Allows you to manually specify a set of allowed fonts. If Allows you to manually specify a set of allowed fonts. If
<code>NULL</code>, all fonts are allowed. This directive <code>NULL</code>, all fonts are allowed. This directive
affects generic names (serif, sans-serif, monospace, cursive, affects generic names (serif, sans-serif, monospace, cursive,
fantasy) as well as specific font families. fantasy) as well as specific font families.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,18 +1,18 @@
CSS.AllowedProperties CSS.AllowedProperties
TYPE: lookup/null TYPE: lookup/null
VERSION: 3.1.0 VERSION: 3.1.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
If HTML Purifier's style attributes set is unsatisfactory for your needs, If HTML Purifier's style attributes set is unsatisfactory for your needs,
you can overload it with your own list of tags to allow. Note that this you can overload it with your own list of tags to allow. Note that this
method is subtractive: it does its job by taking away from HTML Purifier method is subtractive: it does its job by taking away from HTML Purifier
usual feature set, so you cannot add an attribute that HTML Purifier never usual feature set, so you cannot add an attribute that HTML Purifier never
supported in the first place. supported in the first place.
</p> </p>
<p> <p>
<strong>Warning:</strong> If another directive conflicts with the <strong>Warning:</strong> If another directive conflicts with the
elements here, <em>that</em> directive will win and override. elements here, <em>that</em> directive will win and override.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
CSS.DefinitionRev CSS.DefinitionRev
TYPE: int TYPE: int
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 1 DEFAULT: 1
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Revision identifier for your custom definition. See Revision identifier for your custom definition. See
%HTML.DefinitionRev for details. %HTML.DefinitionRev for details.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,13 +1,13 @@
CSS.ForbiddenProperties CSS.ForbiddenProperties
TYPE: lookup TYPE: lookup
VERSION: 4.2.0 VERSION: 4.2.0
DEFAULT: array() DEFAULT: array()
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This is the logical inverse of %CSS.AllowedProperties, and it will This is the logical inverse of %CSS.AllowedProperties, and it will
override that directive or any other directive. If possible, override that directive or any other directive. If possible,
%CSS.AllowedProperties is recommended over this directive, %CSS.AllowedProperties is recommended over this directive,
because it can sometimes be difficult to tell whether or not you've because it can sometimes be difficult to tell whether or not you've
forbidden all of the CSS properties you truly would like to disallow. forbidden all of the CSS properties you truly would like to disallow.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,16 +1,16 @@
CSS.MaxImgLength CSS.MaxImgLength
TYPE: string/null TYPE: string/null
DEFAULT: '1200px' DEFAULT: '1200px'
VERSION: 3.1.1 VERSION: 3.1.1
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This parameter sets the maximum allowed length on <code>img</code> tags, This parameter sets the maximum allowed length on <code>img</code> tags,
effectively the <code>width</code> and <code>height</code> properties. effectively the <code>width</code> and <code>height</code> properties.
Only absolute units of measurement (in, pt, pc, mm, cm) and pixels (px) are allowed. This is Only absolute units of measurement (in, pt, pc, mm, cm) and pixels (px) are allowed. This is
in place to prevent imagecrash attacks, disable with null at your own risk. in place to prevent imagecrash attacks, disable with null at your own risk.
This directive is similar to %HTML.MaxImgLength, and both should be This directive is similar to %HTML.MaxImgLength, and both should be
concurrently edited, although there are concurrently edited, although there are
subtle differences in the input format (the CSS max is a number with subtle differences in the input format (the CSS max is a number with
a unit). a unit).
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,10 +1,10 @@
CSS.Proprietary CSS.Proprietary
TYPE: bool TYPE: bool
VERSION: 3.0.0 VERSION: 3.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Whether or not to allow safe, proprietary CSS values. Whether or not to allow safe, proprietary CSS values.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,9 +1,9 @@
CSS.Trusted CSS.Trusted
TYPE: bool TYPE: bool
VERSION: 4.2.1 VERSION: 4.2.1
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
Indicates whether or not the user's CSS input is trusted or not. If the Indicates whether or not the user's CSS input is trusted or not. If the
input is trusted, a more expansive set of allowed properties. See input is trusted, a more expansive set of allowed properties. See
also %HTML.Trusted. also %HTML.Trusted.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,14 +1,14 @@
Cache.DefinitionImpl Cache.DefinitionImpl
TYPE: string/null TYPE: string/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 'Serializer' DEFAULT: 'Serializer'
--DESCRIPTION-- --DESCRIPTION--
This directive defines which method to use when caching definitions, This directive defines which method to use when caching definitions,
the complex data-type that makes HTML Purifier tick. Set to null the complex data-type that makes HTML Purifier tick. Set to null
to disable caching (not recommended, as you will see a definite to disable caching (not recommended, as you will see a definite
performance degradation). performance degradation).
--ALIASES-- --ALIASES--
Core.DefinitionCache Core.DefinitionCache
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,13 +1,13 @@
Cache.SerializerPath Cache.SerializerPath
TYPE: string/null TYPE: string/null
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: NULL DEFAULT: NULL
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Absolute path with no trailing slash to store serialized definitions in. Absolute path with no trailing slash to store serialized definitions in.
Default is within the Default is within the
HTML Purifier library inside DefinitionCache/Serializer. This HTML Purifier library inside DefinitionCache/Serializer. This
path must be writable by the webserver. path must be writable by the webserver.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
Cache.SerializerPermissions Cache.SerializerPermissions
TYPE: int TYPE: int
VERSION: 4.3.0 VERSION: 4.3.0
DEFAULT: 0755 DEFAULT: 0755
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Directory permissions of the files and directories created inside Directory permissions of the files and directories created inside
the DefinitionCache/Serializer or other custom serializer path. the DefinitionCache/Serializer or other custom serializer path.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,18 +1,18 @@
Core.AggressivelyFixLt Core.AggressivelyFixLt
TYPE: bool TYPE: bool
VERSION: 2.1.0 VERSION: 2.1.0
DEFAULT: true DEFAULT: true
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive enables aggressive pre-filter fixes HTML Purifier can This directive enables aggressive pre-filter fixes HTML Purifier can
perform in order to ensure that open angled-brackets do not get killed perform in order to ensure that open angled-brackets do not get killed
during parsing stage. Enabling this will result in two preg_replace_callback during parsing stage. Enabling this will result in two preg_replace_callback
calls and at least two preg_replace calls for every HTML document parsed; calls and at least two preg_replace calls for every HTML document parsed;
if your users make very well-formed HTML, you can set this directive false. if your users make very well-formed HTML, you can set this directive false.
This has no effect when DirectLex is used. This has no effect when DirectLex is used.
</p> </p>
<p> <p>
<strong>Notice:</strong> This directive's default turned from false to true <strong>Notice:</strong> This directive's default turned from false to true
in HTML Purifier 3.2.0. in HTML Purifier 3.2.0.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -0,0 +1,16 @@
Core.AllowHostnameUnderscore
TYPE: bool
VERSION: 4.6.0
DEFAULT: false
--DESCRIPTION--
<p>
By RFC 1123, underscores are not permitted in host names.
(This is in contrast to the specification for DNS, RFC
2181, which allows underscores.)
However, most browsers do the right thing when faced with
an underscore in the host name, and so some poorly written
websites are written with the expectation this should work.
Setting this parameter to true relaxes our allowed character
check so that underscores are permitted.
</p>
--# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
Core.CollectErrors Core.CollectErrors
TYPE: bool TYPE: bool
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
Whether or not to collect errors found while filtering the document. This Whether or not to collect errors found while filtering the document. This
is a useful way to give feedback to your users. <strong>Warning:</strong> is a useful way to give feedback to your users. <strong>Warning:</strong>
Currently this feature is very patchy and experimental, with lots of Currently this feature is very patchy and experimental, with lots of
possible error messages not yet implemented. It will not cause any possible error messages not yet implemented. It will not cause any
problems, but it may not help your users either. problems, but it may not help your users either.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,29 +1,29 @@
Core.ColorKeywords Core.ColorKeywords
TYPE: hash TYPE: hash
VERSION: 2.0.0 VERSION: 2.0.0
--DEFAULT-- --DEFAULT--
array ( array (
'maroon' => '#800000', 'maroon' => '#800000',
'red' => '#FF0000', 'red' => '#FF0000',
'orange' => '#FFA500', 'orange' => '#FFA500',
'yellow' => '#FFFF00', 'yellow' => '#FFFF00',
'olive' => '#808000', 'olive' => '#808000',
'purple' => '#800080', 'purple' => '#800080',
'fuchsia' => '#FF00FF', 'fuchsia' => '#FF00FF',
'white' => '#FFFFFF', 'white' => '#FFFFFF',
'lime' => '#00FF00', 'lime' => '#00FF00',
'green' => '#008000', 'green' => '#008000',
'navy' => '#000080', 'navy' => '#000080',
'blue' => '#0000FF', 'blue' => '#0000FF',
'aqua' => '#00FFFF', 'aqua' => '#00FFFF',
'teal' => '#008080', 'teal' => '#008080',
'black' => '#000000', 'black' => '#000000',
'silver' => '#C0C0C0', 'silver' => '#C0C0C0',
'gray' => '#808080', 'gray' => '#808080',
) )
--DESCRIPTION-- --DESCRIPTION--
Lookup array of color names to six digit hexadecimal number corresponding Lookup array of color names to six digit hexadecimal number corresponding
to color, with preceding hash mark. Used when parsing colors. The lookup to color, with preceding hash mark. Used when parsing colors. The lookup
is done in a case-insensitive manner. is done in a case-insensitive manner.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,14 +1,14 @@
Core.ConvertDocumentToFragment Core.ConvertDocumentToFragment
TYPE: bool TYPE: bool
DEFAULT: true DEFAULT: true
--DESCRIPTION-- --DESCRIPTION--
This parameter determines whether or not the filter should convert This parameter determines whether or not the filter should convert
input that is a full document with html and body tags to a fragment input that is a full document with html and body tags to a fragment
of just the contents of a body tag. This parameter is simply something of just the contents of a body tag. This parameter is simply something
HTML Purifier can do during an edge-case: for most inputs, this HTML Purifier can do during an edge-case: for most inputs, this
processing is not necessary. processing is not necessary.
--ALIASES-- --ALIASES--
Core.AcceptFullDocuments Core.AcceptFullDocuments
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,17 +1,17 @@
Core.DirectLexLineNumberSyncInterval Core.DirectLexLineNumberSyncInterval
TYPE: int TYPE: int
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 0 DEFAULT: 0
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Specifies the number of tokens the DirectLex line number tracking Specifies the number of tokens the DirectLex line number tracking
implementations should process before attempting to resyncronize the implementations should process before attempting to resyncronize the
current line count by manually counting all previous new-lines. When current line count by manually counting all previous new-lines. When
at 0, this functionality is disabled. Lower values will decrease at 0, this functionality is disabled. Lower values will decrease
performance, and this is only strictly necessary if the counting performance, and this is only strictly necessary if the counting
algorithm is buggy (in which case you should report it as a bug). algorithm is buggy (in which case you should report it as a bug).
This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is
not being used. not being used.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,14 +1,14 @@
Core.DisableExcludes Core.DisableExcludes
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 4.5.0 VERSION: 4.5.0
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive disables SGML-style exclusions, e.g. the exclusion of This directive disables SGML-style exclusions, e.g. the exclusion of
<code>&lt;object&gt;</code> in any descendant of a <code>&lt;object&gt;</code> in any descendant of a
<code>&lt;pre&gt;</code> tag. Disabling excludes will allow some <code>&lt;pre&gt;</code> tag. Disabling excludes will allow some
invalid documents to pass through HTML Purifier, but HTML Purifier invalid documents to pass through HTML Purifier, but HTML Purifier
will also be less likely to accidentally remove large documents during will also be less likely to accidentally remove large documents during
processing. processing.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,9 +1,9 @@
Core.EnableIDNA Core.EnableIDNA
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 4.4.0 VERSION: 4.4.0
--DESCRIPTION-- --DESCRIPTION--
Allows international domain names in URLs. This configuration option Allows international domain names in URLs. This configuration option
requires the PEAR Net_IDNA2 module to be installed. It operates by requires the PEAR Net_IDNA2 module to be installed. It operates by
punycoding any internationalized host names for maximum portability. punycoding any internationalized host names for maximum portability.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,15 +1,15 @@
Core.Encoding Core.Encoding
TYPE: istring TYPE: istring
DEFAULT: 'utf-8' DEFAULT: 'utf-8'
--DESCRIPTION-- --DESCRIPTION--
If for some reason you are unable to convert all webpages to UTF-8, you can If for some reason you are unable to convert all webpages to UTF-8, you can
use this directive as a stop-gap compatibility change to let HTML Purifier use this directive as a stop-gap compatibility change to let HTML Purifier
deal with non UTF-8 input. This technique has notable deficiencies: deal with non UTF-8 input. This technique has notable deficiencies:
absolutely no characters outside of the selected character encoding will be absolutely no characters outside of the selected character encoding will be
preserved, not even the ones that have been ampersand escaped (this is due preserved, not even the ones that have been ampersand escaped (this is due
to a UTF-8 specific <em>feature</em> that automatically resolves all to a UTF-8 specific <em>feature</em> that automatically resolves all
entities), making it pretty useless for anything except the most I18N-blind entities), making it pretty useless for anything except the most I18N-blind
applications, although %Core.EscapeNonASCIICharacters offers fixes this applications, although %Core.EscapeNonASCIICharacters offers fixes this
trouble with another tradeoff. This directive only accepts ISO-8859-1 if trouble with another tradeoff. This directive only accepts ISO-8859-1 if
iconv is not enabled. iconv is not enabled.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,10 +1,12 @@
Core.EscapeInvalidChildren Core.EscapeInvalidChildren
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
When true, a child is found that is not allowed in the context of the <p><strong>Warning:</strong> this configuration option is no longer does anything as of 4.6.0.</p>
parent element will be transformed into text as if it were ASCII. When
false, that element and all internal tags will be dropped, though text will <p>When true, a child is found that is not allowed in the context of the
be preserved. There is no option for dropping the element but preserving parent element will be transformed into text as if it were ASCII. When
child nodes. false, that element and all internal tags will be dropped, though text will
--# vim: et sw=4 sts=4 be preserved. There is no option for dropping the element but preserving
child nodes.</p>
--# vim: et sw=4 sts=4
@@ -1,7 +1,7 @@
Core.EscapeInvalidTags Core.EscapeInvalidTags
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
When true, invalid tags will be written back to the document as plain text. When true, invalid tags will be written back to the document as plain text.
Otherwise, they are silently dropped. Otherwise, they are silently dropped.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,13 +1,13 @@
Core.EscapeNonASCIICharacters Core.EscapeNonASCIICharacters
TYPE: bool TYPE: bool
VERSION: 1.4.0 VERSION: 1.4.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
This directive overcomes a deficiency in %Core.Encoding by blindly This directive overcomes a deficiency in %Core.Encoding by blindly
converting all non-ASCII characters into decimal numeric entities before converting all non-ASCII characters into decimal numeric entities before
converting it to its native encoding. This means that even characters that converting it to its native encoding. This means that even characters that
can be expressed in the non-UTF-8 encoding will be entity-ized, which can can be expressed in the non-UTF-8 encoding will be entity-ized, which can
be a real downer for encodings like Big5. It also assumes that the ASCII be a real downer for encodings like Big5. It also assumes that the ASCII
repetoire is available, although this is the case for almost all encodings. repetoire is available, although this is the case for almost all encodings.
Anyway, use UTF-8! Anyway, use UTF-8!
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,19 +1,19 @@
Core.HiddenElements Core.HiddenElements
TYPE: lookup TYPE: lookup
--DEFAULT-- --DEFAULT--
array ( array (
'script' => true, 'script' => true,
'style' => true, 'style' => true,
) )
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive is a lookup array of elements which should have their This directive is a lookup array of elements which should have their
contents removed when they are not allowed by the HTML definition. contents removed when they are not allowed by the HTML definition.
For example, the contents of a <code>script</code> tag are not For example, the contents of a <code>script</code> tag are not
normally shown in a document, so if script tags are to be removed, normally shown in a document, so if script tags are to be removed,
their contents should be removed to. This is opposed to a <code>b</code> their contents should be removed to. This is opposed to a <code>b</code>
tag, which defines some presentational changes but does not hide its tag, which defines some presentational changes but does not hide its
contents. contents.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,10 +1,10 @@
Core.Language Core.Language
TYPE: string TYPE: string
VERSION: 2.0.0 VERSION: 2.0.0
DEFAULT: 'en' DEFAULT: 'en'
--DESCRIPTION-- --DESCRIPTION--
ISO 639 language code for localizable things in HTML Purifier to use, ISO 639 language code for localizable things in HTML Purifier to use,
which is mainly error reporting. There is currently only an English (en) which is mainly error reporting. There is currently only an English (en)
translation, so this directive is currently useless. translation, so this directive is currently useless.
--# 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