Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a90a38f096 | ||
|
|
68f8836cfb | ||
|
|
1e41f6a8ff | ||
|
|
875a326344 | ||
|
|
7f9664af0a | ||
|
|
8755c8ece7 | ||
|
|
66358414f2 | ||
|
|
bc68c4bc70 | ||
|
|
82279c376b | ||
|
|
8b096e770c | ||
|
|
6bf57bd4c6 | ||
|
|
ea55f3880e | ||
|
|
19e0ea60a7 | ||
|
|
7831d9dfb6 | ||
|
|
907db24187 | ||
|
|
5a424d5977 | ||
|
|
6c4353fffe | ||
|
|
fd1ec11ad1 | ||
|
|
9f89455b3c | ||
|
|
7d8e2e4fdd | ||
|
|
0aa4ae0b96 | ||
|
|
04620f2475 | ||
|
|
6cfb34ab22 | ||
|
|
e46af305a9 | ||
|
|
2fe00e5e96 | ||
|
|
2c7f9bd449 | ||
|
|
d1ee1eb4e1 | ||
|
|
f9dd7644cc | ||
|
|
3f94d86db4 | ||
|
|
9882234645 | ||
|
|
838f1a0678 | ||
|
|
c111b2beaf | ||
|
|
ebad7240cc | ||
|
|
8ed85a5fb4 | ||
|
|
3beaf71e16 | ||
|
|
38f1e838a5 | ||
|
|
0f4ec77ac0 |
No files matched your search
+12
-3
@@ -176,7 +176,7 @@ function get_theme_config_value($dir, $key='*')
|
|||||||
$tconfig = array();
|
$tconfig = array();
|
||||||
|
|
||||||
$theme_config_file = G5_PATH.'/'.G5_THEME_DIR.'/'.$dir.'/theme.config.php';
|
$theme_config_file = G5_PATH.'/'.G5_THEME_DIR.'/'.$dir.'/theme.config.php';
|
||||||
if(is_file) {
|
if(is_file($theme_config_file)) {
|
||||||
include($theme_config_file);
|
include($theme_config_file);
|
||||||
|
|
||||||
if($key == '*') {
|
if($key == '*') {
|
||||||
@@ -382,15 +382,24 @@ function admin_referer_check($return=false)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$p = @parse_url($referer);
|
$p = @parse_url($referer);
|
||||||
|
|
||||||
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
|
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
|
||||||
|
$msg = '';
|
||||||
|
|
||||||
if($host != $p['host']) {
|
if($host != $p['host']) {
|
||||||
$msg = '올바른 방법으로 이용해 주십시오.';
|
$msg = '올바른 방법으로 이용해 주십시오.';
|
||||||
|
}
|
||||||
|
|
||||||
if($return)
|
if( $p['path'] && ! preg_match( '/\/'.preg_quote(G5_ADMIN_DIR).'\//i', $p['path'] ) ){
|
||||||
|
$msg = '올바른 방법으로 이용해 주십시오';
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $msg ){
|
||||||
|
if($return) {
|
||||||
return $msg;
|
return $msg;
|
||||||
else
|
} else {
|
||||||
alert($msg, G5_URL);
|
alert($msg, G5_URL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('_GNUBOARD_')) exit;
|
if (!defined('_GNUBOARD_')) exit;
|
||||||
|
|
||||||
$print_version = (defined('G5_IS_SHOP_ADMIN_PAGE') && defined('G5_YOUNGCART_VER')) ? 'Cart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
|
$print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<noscript>
|
<noscript>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if ($file = $_POST['bo_include_head']) {
|
|||||||
$purl = parse_url($file);
|
$purl = parse_url($file);
|
||||||
$file = $purl['path'];
|
$file = $purl['path'];
|
||||||
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
||||||
alert('상단 파일 경로가 php, html 파일이 아닙니다.');
|
alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.');
|
||||||
}
|
}
|
||||||
$_POST['bo_include_head'] = $file;
|
$_POST['bo_include_head'] = $file;
|
||||||
}
|
}
|
||||||
@@ -30,16 +30,16 @@ if ($file = $_POST['bo_include_tail']) {
|
|||||||
$purl = parse_url($file);
|
$purl = parse_url($file);
|
||||||
$file = $purl['path'];
|
$file = $purl['path'];
|
||||||
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
||||||
alert('하단 파일 경로가 php, html 파일이 아닙니다.');
|
alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.');
|
||||||
}
|
}
|
||||||
$_POST['bo_include_tail'] = $file;
|
$_POST['bo_include_tail'] = $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_include_path_check($_POST['bo_include_head'])) {
|
if(!is_include_path_check($_POST['bo_include_head'], 1)) {
|
||||||
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.');
|
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_include_path_check($_POST['bo_include_tail'])) {
|
if(!is_include_path_check($_POST['bo_include_tail'], 1)) {
|
||||||
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.');
|
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,10 @@ if ($_POST['act_button'] == "선택수정") {
|
|||||||
|
|
||||||
// include 전에 $bo_table 값을 반드시 넘겨야 함
|
// include 전에 $bo_table 값을 반드시 넘겨야 함
|
||||||
$tmp_bo_table = trim($_POST['board_table'][$k]);
|
$tmp_bo_table = trim($_POST['board_table'][$k]);
|
||||||
include ('./board_delete.inc.php');
|
|
||||||
|
if( preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table) ){
|
||||||
|
include ('./board_delete.inc.php');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,22 @@ if ($co_timg_del) @unlink(G5_DATA_PATH."/content/{$co_id}_t");
|
|||||||
|
|
||||||
$error_msg = '';
|
$error_msg = '';
|
||||||
|
|
||||||
|
if( $co_include_head ){
|
||||||
|
$purl = parse_url($co_include_head);
|
||||||
|
$file = $purl['path'];
|
||||||
|
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
||||||
|
alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $co_include_tail ){
|
||||||
|
$purl = parse_url($co_include_tail);
|
||||||
|
$file = $purl['path'];
|
||||||
|
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
||||||
|
alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( $co_include_head && ! is_include_path_check($co_include_head) ){
|
if( $co_include_head && ! is_include_path_check($co_include_head) ){
|
||||||
$co_include_head = '';
|
$co_include_head = '';
|
||||||
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
|
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ include_once('./admin.head.php');
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<textarea name="ma_list" style="display:none"><?=$ma_list?></textarea>
|
<textarea name="ma_list" style="display:none"><?php echo $ma_list?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn_confirm01 btn_confirm">
|
<div class="btn_confirm01 btn_confirm">
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ if (!count($_POST['chk'])) {
|
|||||||
|
|
||||||
auth_check($auth[$sub_menu], 'w');
|
auth_check($auth[$sub_menu], 'w');
|
||||||
|
|
||||||
|
check_admin_token();
|
||||||
|
|
||||||
if ($_POST['act_button'] == "선택수정") {
|
if ($_POST['act_button'] == "선택수정") {
|
||||||
|
|
||||||
for ($i=0; $i<count($_POST['chk']); $i++)
|
for ($i=0; $i<count($_POST['chk']); $i++)
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ if ($is_admin != 'super')
|
|||||||
$g5['title'] = '메뉴 추가';
|
$g5['title'] = '메뉴 추가';
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
|
|
||||||
|
$code = isset($code) ? preg_replace('/[^0-9a-zA-Z]/', '', strip_tags($code)) : '';
|
||||||
|
|
||||||
// 코드
|
// 코드
|
||||||
if($new == 'new' || !$code) {
|
if($new == 'new' || !$code) {
|
||||||
$code = base_convert(substr($code,0, 2), 36, 10);
|
$code = base_convert(substr($code,0, 2), 36, 10);
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ include_once('./_common.php');
|
|||||||
|
|
||||||
auth_check($auth[$sub_menu], 'w');
|
auth_check($auth[$sub_menu], 'w');
|
||||||
|
|
||||||
|
$po_id = isset($po_id) ? (int) $po_id : 0;
|
||||||
|
|
||||||
$html_title = '투표';
|
$html_title = '투표';
|
||||||
if ($w == '')
|
if ($w == '')
|
||||||
$html_title .= ' 생성';
|
$html_title .= ' 생성';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ auth_check($auth[$sub_menu], 'r');
|
|||||||
if (empty($fr_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $fr_date) ) $fr_date = G5_TIME_YMD;
|
if (empty($fr_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $fr_date) ) $fr_date = G5_TIME_YMD;
|
||||||
if (empty($to_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $to_date) ) $to_date = G5_TIME_YMD;
|
if (empty($to_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $to_date) ) $to_date = G5_TIME_YMD;
|
||||||
|
|
||||||
$qstr = "fr_date={$fr_date}{&to_date}={$to_date}";
|
$qstr = "fr_date={$fr_date}&to_date={$to_date}";
|
||||||
|
|
||||||
$sql_common = " from {$g5['popular_table']} a ";
|
$sql_common = " from {$g5['popular_table']} a ";
|
||||||
$sql_search = " where trim(pp_word) <> '' and pp_date between '{$fr_date}' and '{$to_date}' ";
|
$sql_search = " where trim(pp_word) <> '' and pp_date between '{$fr_date}' and '{$to_date}' ";
|
||||||
|
|||||||
@@ -10,12 +10,28 @@ check_admin_token();
|
|||||||
|
|
||||||
$error_msg = '';
|
$error_msg = '';
|
||||||
|
|
||||||
if( $qa_include_head && ! is_include_path_check($qa_include_head) ){
|
if( $qa_include_head ){
|
||||||
|
$purl = parse_url($qa_include_head);
|
||||||
|
$file = $purl['path'];
|
||||||
|
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
||||||
|
alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $qa_include_tail ){
|
||||||
|
$purl = parse_url($qa_include_tail);
|
||||||
|
$file = $purl['path'];
|
||||||
|
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
|
||||||
|
alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $qa_include_head && ! is_include_path_check($qa_include_head, 1) ){
|
||||||
$qa_include_head = '';
|
$qa_include_head = '';
|
||||||
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
|
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $qa_include_tail && ! is_include_path_check($qa_include_tail) ){
|
if( $qa_include_tail && ! is_include_path_check($qa_include_tail, 1) ){
|
||||||
$qa_include_tail = '';
|
$qa_include_tail = '';
|
||||||
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
|
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-17
@@ -13,26 +13,37 @@ $g5['title'] = '메일 테스트';
|
|||||||
include_once('./admin.head.php');
|
include_once('./admin.head.php');
|
||||||
|
|
||||||
if (isset($_POST['email'])) {
|
if (isset($_POST['email'])) {
|
||||||
|
$_POST['email'] = strip_tags($_POST['email']);
|
||||||
$email = explode(',', $_POST['email']);
|
$email = explode(',', $_POST['email']);
|
||||||
for ($i=0; $i<count($email); $i++)
|
|
||||||
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], trim($email[$i]), '[메일검사] 제목', '<span style="font-size:9pt;">[메일검사] 내용<p>이 내용이 제대로 보인다면 보내는 메일 서버에는 이상이 없는것입니다.<p>'.G5_TIME_YMDHIS.'<p>이 메일 주소로는 회신되지 않습니다.</span>', 1);
|
|
||||||
|
|
||||||
echo '<section>';
|
$real_email = array();
|
||||||
echo '<h2>결과메세지</h2>';
|
|
||||||
echo '<div class="local_desc01 local_desc"><p>';
|
for ($i=0; $i<count($email); $i++){
|
||||||
echo '다음 '.count($email).'개의 메일 주소로 테스트 메일 발송이 완료되었습니다.';
|
|
||||||
echo '</p></div>';
|
if (!preg_match("/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/", $email[$i])) continue;
|
||||||
echo '<ul>';
|
|
||||||
for ($i=0;$i<count($email);$i++) {
|
$real_email[] = $email[$i];
|
||||||
echo '<li>'.$email[$i].'</li>';
|
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], trim($email[$i]), '[메일검사] 제목', '<span style="font-size:9pt;">[메일검사] 내용<p>이 내용이 제대로 보인다면 보내는 메일 서버에는 이상이 없는것입니다.<p>'.G5_TIME_YMDHIS.'<p>이 메일 주소로는 회신되지 않습니다.</span>', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $real_email ){
|
||||||
|
echo '<section>';
|
||||||
|
echo '<h2>결과메세지</h2>';
|
||||||
|
echo '<div class="local_desc01 local_desc"><p>';
|
||||||
|
echo '다음 '.count($real_email).'개의 메일 주소로 테스트 메일 발송이 완료되었습니다.';
|
||||||
|
echo '</p></div>';
|
||||||
|
echo '<ul>';
|
||||||
|
for ($i=0;$i<count($real_email);$i++) {
|
||||||
|
echo '<li>'.$real_email[$i].'</li>';
|
||||||
|
}
|
||||||
|
echo '</ul>';
|
||||||
|
echo '<div class="local_desc02 local_desc"><p>';
|
||||||
|
echo '해당 주소로 테스트 메일이 도착했는지 확인해 주십시오.<br>';
|
||||||
|
echo '만약, 테스트 메일이 오지 않는다면 더 다양한 계정의 메일 주소로 메일을 보내 보십시오.<br>';
|
||||||
|
echo '그래도 메일이 하나도 도착하지 않는다면 메일 서버(sendmail server)의 오류일 가능성이 높으니, 웹 서버관리자에게 문의하여 주십시오.<br>';
|
||||||
|
echo '</p></div>';
|
||||||
|
echo '</section>';
|
||||||
}
|
}
|
||||||
echo '</ul>';
|
|
||||||
echo '<div class="local_desc02 local_desc"><p>';
|
|
||||||
echo '해당 주소로 테스트 메일이 도착했는지 확인해 주십시오.<br>';
|
|
||||||
echo '만약, 테스트 메일이 오지 않는다면 더 다양한 계정의 메일 주소로 메일을 보내 보십시오.<br>';
|
|
||||||
echo '그래도 메일이 하나도 도착하지 않는다면 메일 서버(sendmail server)의 오류일 가능성이 높으니, 웹 서버관리자에게 문의하여 주십시오.<br>';
|
|
||||||
echo '</p></div>';
|
|
||||||
echo '</section>';
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ if ($w == 'u') // 업데이트
|
|||||||
{
|
{
|
||||||
// 실제 번호를 넘김
|
// 실제 번호를 넘김
|
||||||
$k = $_POST['chk'][$i];
|
$k = $_POST['chk'][$i];
|
||||||
$fg_no = $_POST['fg_no'][$k];
|
$fg_no = (int) $_POST['fg_no'][$k];
|
||||||
$fg_name = $_POST['fg_name'][$k];
|
$fg_name = strip_tags($_POST['fg_name'][$k]);
|
||||||
$fg_member = $_POST['fg_member'][$k];
|
$fg_member = strip_tags($_POST['fg_member'][$k]);
|
||||||
|
|
||||||
if (!is_numeric($fg_no))
|
if (!is_numeric($fg_no))
|
||||||
alert('그룹 고유번호가 없습니다.');
|
alert('그룹 고유번호가 없습니다.');
|
||||||
@@ -38,7 +38,7 @@ else if ($w == 'de') // 그룹삭제
|
|||||||
{
|
{
|
||||||
// 실제 번호를 넘김
|
// 실제 번호를 넘김
|
||||||
$k = $_POST['chk'][$i];
|
$k = $_POST['chk'][$i];
|
||||||
$fg_no = $_POST['fg_no'][$k];
|
$fg_no = (int) $_POST['fg_no'][$k];
|
||||||
|
|
||||||
if (!is_numeric($fg_no))
|
if (!is_numeric($fg_no))
|
||||||
alert('그룹 고유번호가 없습니다.');
|
alert('그룹 고유번호가 없습니다.');
|
||||||
@@ -57,7 +57,7 @@ else if ($w == 'em')
|
|||||||
{
|
{
|
||||||
// 실제 번호를 넘김
|
// 실제 번호를 넘김
|
||||||
$k = $_POST['chk'][$i];
|
$k = $_POST['chk'][$i];
|
||||||
$fg_no = $_POST['fg_no'][$k];
|
$fg_no = (int) $_POST['fg_no'][$k];
|
||||||
|
|
||||||
if ($fg_no == 'no') $fg_no = 0;
|
if ($fg_no == 'no') $fg_no = 0;
|
||||||
|
|
||||||
@@ -71,6 +71,8 @@ else if ($w == 'no')
|
|||||||
{
|
{
|
||||||
if ($fg_no == 'no') $fg_no = 0;
|
if ($fg_no == 'no') $fg_no = 0;
|
||||||
|
|
||||||
|
$fg_no = (int) $fg_no;
|
||||||
|
|
||||||
if ($fg_no)
|
if ($fg_no)
|
||||||
sql_query("update {$g5['sms5_form_group_table']} set fg_count = 0 where fg_no = '$fg_no'");
|
sql_query("update {$g5['sms5_form_group_table']} set fg_count = 0 where fg_no = '$fg_no'");
|
||||||
|
|
||||||
@@ -81,6 +83,8 @@ else // 등록
|
|||||||
if (!strlen(trim($fg_name)))
|
if (!strlen(trim($fg_name)))
|
||||||
alert('그룹명을 입력해주세요');
|
alert('그룹명을 입력해주세요');
|
||||||
|
|
||||||
|
$fg_name = strip_tags($fg_name);
|
||||||
|
|
||||||
$res = sql_fetch("select fg_name from {$g5['sms5_form_group_table']} where fg_name = '$fg_name'");
|
$res = sql_fetch("select fg_name from {$g5['sms5_form_group_table']} where fg_name = '$fg_name'");
|
||||||
if ($res)
|
if ($res)
|
||||||
alert('같은 그룹명이 존재합니다.');
|
alert('같은 그룹명이 존재합니다.');
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ include_once("./_common.php");
|
|||||||
|
|
||||||
auth_check($auth[$sub_menu], "w");
|
auth_check($auth[$sub_menu], "w");
|
||||||
|
|
||||||
|
$fo_name = isset($fo_name) ? strip_tags($fo_name) : '';
|
||||||
|
$fo_content = isset($fo_content) ? strip_tags($fo_content) : '';
|
||||||
|
|
||||||
$g5['title'] = "이모티콘 업데이트";
|
$g5['title'] = "이모티콘 업데이트";
|
||||||
|
|
||||||
if ($w == 'u') // 업데이트
|
if ($w == 'u') // 업데이트
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ if ($w == 'u') // 업데이트
|
|||||||
{
|
{
|
||||||
// 실제 번호를 넘김
|
// 실제 번호를 넘김
|
||||||
$k = $_POST['chk'][$i];
|
$k = $_POST['chk'][$i];
|
||||||
$bg_no = $_POST['bg_no'][$k];
|
$bg_no = (int) $_POST['bg_no'][$k];
|
||||||
$bg_name = $_POST['bg_name'][$k];
|
$bg_name = strip_tags($_POST['bg_name'][$k]);
|
||||||
|
|
||||||
if (!is_numeric($bg_no))
|
if (!is_numeric($bg_no))
|
||||||
alert('그룹 고유번호가 없습니다.');
|
alert('그룹 고유번호가 없습니다.');
|
||||||
@@ -36,7 +36,7 @@ else if ($w == 'de') // 그룹삭제
|
|||||||
{
|
{
|
||||||
// 실제 번호를 넘김
|
// 실제 번호를 넘김
|
||||||
$k = $_POST['chk'][$i];
|
$k = $_POST['chk'][$i];
|
||||||
$bg_no = $_POST['bg_no'][$k];
|
$bg_no = (int) $_POST['bg_no'][$k];
|
||||||
|
|
||||||
if (!is_numeric($bg_no))
|
if (!is_numeric($bg_no))
|
||||||
alert('그룹 고유번호가 없습니다.');
|
alert('그룹 고유번호가 없습니다.');
|
||||||
@@ -55,7 +55,7 @@ else if ($w == 'em') // 비우기
|
|||||||
{
|
{
|
||||||
// 실제 번호를 넘김
|
// 실제 번호를 넘김
|
||||||
$k = $_POST['chk'][$i];
|
$k = $_POST['chk'][$i];
|
||||||
$bg_no = $_POST['bg_no'][$k];
|
$bg_no = (int) $_POST['bg_no'][$k];
|
||||||
|
|
||||||
sql_query("update {$g5['sms5_book_group_table']} set bg_count = 0, bg_member = 0, bg_nomember = 0, bg_receipt = 0, bg_reject = 0 where bg_no='$bg_no'");
|
sql_query("update {$g5['sms5_book_group_table']} set bg_count = 0, bg_member = 0, bg_nomember = 0, bg_receipt = 0, bg_reject = 0 where bg_no='$bg_no'");
|
||||||
sql_query("delete from {$g5['sms5_book_table']} where bg_no='$bg_no'");
|
sql_query("delete from {$g5['sms5_book_table']} where bg_no='$bg_no'");
|
||||||
@@ -63,6 +63,8 @@ else if ($w == 'em') // 비우기
|
|||||||
}
|
}
|
||||||
else // 등록
|
else // 등록
|
||||||
{
|
{
|
||||||
|
$bg_name = strip_tags($bg_name);
|
||||||
|
|
||||||
if (!strlen(trim($bg_name)))
|
if (!strlen(trim($bg_name)))
|
||||||
alert('그룹명을 입력해주세요');
|
alert('그룹명을 입력해주세요');
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'">처음</a>'; //페이지 처
|
|||||||
|
|
||||||
<div class="local_sch local_sch01">
|
<div class="local_sch local_sch01">
|
||||||
<form name="fvisit" method="get" onsubmit="return fvisit_submit(this);">
|
<form name="fvisit" method="get" onsubmit="return fvisit_submit(this);">
|
||||||
<?=$listall?>
|
<?php echo $listall?>
|
||||||
<label for="sch_sort" class="sound_only">검색분류</label>
|
<label for="sch_sort" class="sound_only">검색분류</label>
|
||||||
<select name="sfl" id="sch_sort" class="search_sort">
|
<select name="sfl" id="sch_sort" class="search_sort">
|
||||||
<option value="vi_ip"<?php echo get_selected($sfl, 'vi_ip'); ?>>IP</option>
|
<option value="vi_ip"<?php echo get_selected($sfl, 'vi_ip'); ?>>IP</option>
|
||||||
|
|||||||
+2
-2
@@ -28,9 +28,9 @@ include_once(G5_LIB_PATH.'/latest.lib.php');
|
|||||||
<?php
|
<?php
|
||||||
// 최신글
|
// 최신글
|
||||||
$sql = " select bo_table, bo_subject
|
$sql = " select bo_table, bo_subject
|
||||||
from {$g5[board_table]}
|
from {$g5['board_table']}
|
||||||
where gr_id = '{$gr_id}'
|
where gr_id = '{$gr_id}'
|
||||||
and bo_list_level <= '{$member[mb_level]}'
|
and bo_list_level <= '{$member['mb_level']}'
|
||||||
and bo_device <> 'mobile' ";
|
and bo_device <> 'mobile' ";
|
||||||
if(!$is_admin)
|
if(!$is_admin)
|
||||||
$sql .= " and bo_use_cert = '' ";
|
$sql .= " and bo_use_cert = '' ";
|
||||||
|
|||||||
+4
-1
@@ -11,7 +11,10 @@ set_cookie('ck_auto', '', 0);
|
|||||||
// 자동로그인 해제 end --------------------------------
|
// 자동로그인 해제 end --------------------------------
|
||||||
|
|
||||||
if ($url) {
|
if ($url) {
|
||||||
$p = @parse_url($url);
|
if ( substr($url, 0, 2) == '//' )
|
||||||
|
$url = 'http:' . $url;
|
||||||
|
|
||||||
|
$p = @parse_url(urldecode($url));
|
||||||
if ($p['scheme'] || $p['host']) {
|
if ($p['scheme'] || $p['host']) {
|
||||||
alert('url에 도메인을 지정할 수 없습니다.');
|
alert('url에 도메인을 지정할 수 없습니다.');
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -4,10 +4,12 @@ include_once('./_common.php');
|
|||||||
if ($is_guest)
|
if ($is_guest)
|
||||||
alert_close('회원만 이용하실 수 있습니다.');
|
alert_close('회원만 이용하실 수 있습니다.');
|
||||||
|
|
||||||
|
set_session('ss_memo_delete_token', $token = uniqid(time()));
|
||||||
|
|
||||||
$g5['title'] = '내 쪽지함';
|
$g5['title'] = '내 쪽지함';
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
|
|
||||||
if (!$kind) $kind = 'recv';
|
$kind = $kind ? clean_xss_tags(strip_tags($kind)) : 'recv';
|
||||||
|
|
||||||
if ($kind == 'recv')
|
if ($kind == 'recv')
|
||||||
$unkind = 'send';
|
$unkind = 'send';
|
||||||
@@ -65,7 +67,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
|||||||
$list[$i]['send_datetime'] = $send_datetime;
|
$list[$i]['send_datetime'] = $send_datetime;
|
||||||
$list[$i]['read_datetime'] = $read_datetime;
|
$list[$i]['read_datetime'] = $read_datetime;
|
||||||
$list[$i]['view_href'] = './memo_view.php?me_id='.$row['me_id'].'&kind='.$kind;
|
$list[$i]['view_href'] = './memo_view.php?me_id='.$row['me_id'].'&kind='.$kind;
|
||||||
$list[$i]['del_href'] = './memo_delete.php?me_id='.$row['me_id'].'&kind='.$kind;
|
$list[$i]['del_href'] = './memo_delete.php?me_id='.$row['me_id'].'&token='.$token.'&kind='.$kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($member_skin_path.'/memo.skin.php');
|
include_once($member_skin_path.'/memo.skin.php');
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ include_once('./_common.php');
|
|||||||
if (!$is_member)
|
if (!$is_member)
|
||||||
alert('회원만 이용하실 수 있습니다.');
|
alert('회원만 이용하실 수 있습니다.');
|
||||||
|
|
||||||
|
$delete_token = get_session('ss_memo_delete_token');
|
||||||
|
set_session('ss_memo_delete_token', '');
|
||||||
|
|
||||||
|
if (!($token && $delete_token == $token))
|
||||||
|
alert('토큰 에러로 삭제 불가합니다.');
|
||||||
|
|
||||||
$me_id = (int)$_REQUEST['me_id'];
|
$me_id = (int)$_REQUEST['me_id'];
|
||||||
|
|
||||||
$sql = " select * from {$g5['memo_table']} where me_id = '{$me_id}' ";
|
$sql = " select * from {$g5['memo_table']} where me_id = '{$me_id}' ";
|
||||||
|
|||||||
+4
-2
@@ -115,7 +115,9 @@ while ($row = sql_fetch_array($result))
|
|||||||
if ($row3['bf_file'])
|
if ($row3['bf_file'])
|
||||||
{
|
{
|
||||||
// 원본파일을 복사하고 퍼미션을 변경
|
// 원본파일을 복사하고 퍼미션을 변경
|
||||||
@copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$row3['bf_file']);
|
// 제이프로님 코드제안 적용
|
||||||
|
$copy_file_name = ($bo_table !== $move_bo_table) ? $row3['bf_file'] : $row2['wr_id'].'_copy_'.$insert_id.'_'.$row3['bf_file'];
|
||||||
|
@copy($src_dir.'/'.$row3['bf_file'], $dst_dir.'/'.$copy_file_name);
|
||||||
@chmod($dst_dir/$row3['bf_file'], G5_FILE_PERMISSION);
|
@chmod($dst_dir/$row3['bf_file'], G5_FILE_PERMISSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +126,7 @@ while ($row = sql_fetch_array($result))
|
|||||||
wr_id = '$insert_id',
|
wr_id = '$insert_id',
|
||||||
bf_no = '{$row3['bf_no']}',
|
bf_no = '{$row3['bf_no']}',
|
||||||
bf_source = '".addslashes($row3['bf_source'])."',
|
bf_source = '".addslashes($row3['bf_source'])."',
|
||||||
bf_file = '{$row3['bf_file']}',
|
bf_file = '$copy_file_name',
|
||||||
bf_download = '{$row3['bf_download']}',
|
bf_download = '{$row3['bf_download']}',
|
||||||
bf_content = '".addslashes($row3['bf_content'])."',
|
bf_content = '".addslashes($row3['bf_content'])."',
|
||||||
bf_filesize = '{$row3['bf_filesize']}',
|
bf_filesize = '{$row3['bf_filesize']}',
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ for($i=0;$i<count($_POST['chk_bn_id']);$i++)
|
|||||||
|
|
||||||
if ($pressed == '선택내용삭제') {
|
if ($pressed == '선택내용삭제') {
|
||||||
// 게시글 내용만 삭제
|
// 게시글 내용만 삭제
|
||||||
sql_query(" update $write_table set wr_subject = '{$g5['time_ymdhis']} - 본인 요청으로 인한 삭제 (냉무) ☆', wr_content = '', wr_name='본인요청삭제☆' where wr_id = '{$write['wr_id']}' ");
|
sql_query(" update $write_table set wr_subject = '".G5_TIME_YMDHIS." - 본인 요청으로 인한 삭제 (냉무) ☆', wr_content = '', wr_name='본인요청삭제☆' where wr_id = '{$write['wr_id']}' ");
|
||||||
} else {
|
} else {
|
||||||
// 게시글 삭제
|
// 게시글 삭제
|
||||||
sql_query(" delete from $write_table where wr_parent = '{$write['wr_id']}' ");
|
sql_query(" delete from $write_table where wr_parent = '{$write['wr_id']}' ");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
|
|||||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||||
|
|
||||||
if ($is_member) {
|
if ($is_member) {
|
||||||
alert('이미 로그인중입니다.');
|
alert_close('이미 로그인중입니다.', G5_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chk_captcha()) {
|
if (!chk_captcha()) {
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ include_once('./_common.php');
|
|||||||
if($is_guest)
|
if($is_guest)
|
||||||
alert('회원이시라면 로그인 후 이용해 주십시오.', G5_URL);
|
alert('회원이시라면 로그인 후 이용해 주십시오.', G5_URL);
|
||||||
|
|
||||||
|
$delete_token = get_session('ss_qa_delete_token');
|
||||||
|
set_session('ss_qa_delete_token', '');
|
||||||
|
|
||||||
|
if (!($token && $delete_token == $token))
|
||||||
|
alert('토큰 에러로 삭제 불가합니다.');
|
||||||
|
|
||||||
$tmp_array = array();
|
$tmp_array = array();
|
||||||
if ($qa_id) // 건별삭제
|
if ($qa_id) // 건별삭제
|
||||||
$tmp_array[0] = $qa_id;
|
$tmp_array[0] = $qa_id;
|
||||||
|
|||||||
+2
-1
@@ -109,7 +109,8 @@ if(is_file($skin_file)) {
|
|||||||
*/
|
*/
|
||||||
if(($view['qa_type'] && $is_admin) || (!$view['qa_type'] && $view['qa_status'] == 0)) {
|
if(($view['qa_type'] && $is_admin) || (!$view['qa_type'] && $view['qa_status'] == 0)) {
|
||||||
$update_href = G5_BBS_URL.'/qawrite.php?w=u&qa_id='.$view['qa_id'].$qstr;
|
$update_href = G5_BBS_URL.'/qawrite.php?w=u&qa_id='.$view['qa_id'].$qstr;
|
||||||
$delete_href = G5_BBS_URL.'/qadelete.php?qa_id='.$view['qa_id'].$qstr;
|
set_session('ss_qa_delete_token', $token = uniqid(time()));
|
||||||
|
$delete_href = G5_BBS_URL.'/qadelete.php?qa_id='.$view['qa_id'].'&token='.$token.$qstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 질문글이고 등록된 답변이 있다면
|
// 질문글이고 등록된 답변이 있다면
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ for ($i=1; $i<=count($_FILES['bf_file']['name']); $i++) {
|
|||||||
$upload[$i]['filesize'] = $filesize;
|
$upload[$i]['filesize'] = $filesize;
|
||||||
|
|
||||||
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
|
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
|
||||||
$filename = preg_replace("/\.(php|phtm|htm|cgi|pl|exe|jsp|asp|inc)/i", "$0-x", $filename);
|
$filename = preg_replace("/\.(php|pht|phtm|htm|cgi|pl|exe|jsp|asp|inc)/i", "$0-x", $filename);
|
||||||
|
|
||||||
shuffle($chars_array);
|
shuffle($chars_array);
|
||||||
$shuffle = implode('', $chars_array);
|
$shuffle = implode('', $chars_array);
|
||||||
|
|||||||
@@ -524,7 +524,7 @@ for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
|
|||||||
$upload[$i]['filesize'] = $filesize;
|
$upload[$i]['filesize'] = $filesize;
|
||||||
|
|
||||||
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
|
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
|
||||||
$filename = preg_replace("/\.(php|phtm|htm|cgi|pl|exe|jsp|asp|inc)/i", "$0-x", $filename);
|
$filename = preg_replace("/\.(php|pht|phtm|htm|cgi|pl|exe|jsp|asp|inc)/i", "$0-x", $filename);
|
||||||
|
|
||||||
shuffle($chars_array);
|
shuffle($chars_array);
|
||||||
$shuffle = implode('', $chars_array);
|
$shuffle = implode('', $chars_array);
|
||||||
|
|||||||
+4
-3
@@ -29,7 +29,8 @@ for ($i=0; $i<$ext_cnt; $i++) {
|
|||||||
|
|
||||||
function g5_path()
|
function g5_path()
|
||||||
{
|
{
|
||||||
$result['path'] = str_replace('\\', '/', dirname(__FILE__));
|
$chroot = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], dirname(__FILE__)));
|
||||||
|
$result['path'] = str_replace('\\', '/', $chroot.dirname(__FILE__));
|
||||||
$tilde_remove = preg_replace('/^\/\~[^\/]+(.*)$/', '$1', $_SERVER['SCRIPT_NAME']);
|
$tilde_remove = preg_replace('/^\/\~[^\/]+(.*)$/', '$1', $_SERVER['SCRIPT_NAME']);
|
||||||
$document_root = str_replace($tilde_remove, '', $_SERVER['SCRIPT_FILENAME']);
|
$document_root = str_replace($tilde_remove, '', $_SERVER['SCRIPT_FILENAME']);
|
||||||
$pattern = '/' . preg_quote($document_root, '/') . '/i';
|
$pattern = '/' . preg_quote($document_root, '/') . '/i';
|
||||||
@@ -139,7 +140,7 @@ if (file_exists($dbconfig_file)) {
|
|||||||
|
|
||||||
sql_set_charset('utf8', $connect_db);
|
sql_set_charset('utf8', $connect_db);
|
||||||
if(defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE) sql_query("SET SESSION sql_mode = ''");
|
if(defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE) sql_query("SET SESSION sql_mode = ''");
|
||||||
if (defined(G5_TIMEZONE)) sql_query(" set time_zone = '".G5_TIMEZONE."'");
|
if (defined('G5_TIMEZONE')) sql_query(" set time_zone = '".G5_TIMEZONE."'");
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -485,7 +486,7 @@ if(isset($config['cf_theme']) && trim($config['cf_theme'])) {
|
|||||||
|
|
||||||
|
|
||||||
// 테마 설정 로드
|
// 테마 설정 로드
|
||||||
if(is_file(G5_THEME_PATH.'/theme.config.php'))
|
if(defined('G5_THEME_PATH') && is_file(G5_THEME_PATH.'/theme.config.php'))
|
||||||
include_once(G5_THEME_PATH.'/theme.config.php');
|
include_once(G5_THEME_PATH.'/theme.config.php');
|
||||||
|
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
********************/
|
********************/
|
||||||
|
|
||||||
define('G5_VERSION', '그누보드5');
|
define('G5_VERSION', '그누보드5');
|
||||||
define('G5_GNUBOARD_VER', '5.2.9.3');
|
define('G5_GNUBOARD_VER', '5.2.9.8');
|
||||||
|
|
||||||
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
|
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
|
||||||
define('_GNUBOARD_', true);
|
define('_GNUBOARD_', true);
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ if($is_admin != 'super')
|
|||||||
<p>프로그램을 실행하시려면 그누보드4의 config.php 파일 경로를 입력하신 후 확인을 클릭해 주십시오.</p>
|
<p>프로그램을 실행하시려면 그누보드4의 config.php 파일 경로를 입력하신 후 확인을 클릭해 주십시오.</p>
|
||||||
|
|
||||||
<form name="fimport" method="post" action="./g4_import_run.php" onsubmit="return fimport_submit(this);">
|
<form name="fimport" method="post" action="./g4_import_run.php" onsubmit="return fimport_submit(this);">
|
||||||
|
<input type="hidden" name="token" value="" >
|
||||||
<div id="g4_import_frm">
|
<div id="g4_import_frm">
|
||||||
<label for="file_path">config.php 파일 경로</label>
|
<label for="file_path">config.php 파일 경로</label>
|
||||||
<input type="text" name="file_path" id="file_path" required class="frm_input required">
|
<input type="text" name="file_path" id="file_path" required class="frm_input required">
|
||||||
@@ -142,6 +143,10 @@ if($is_admin != 'super')
|
|||||||
<script>
|
<script>
|
||||||
function fimport_submit(f)
|
function fimport_submit(f)
|
||||||
{
|
{
|
||||||
|
var token = get_write_token('g4_import');
|
||||||
|
|
||||||
|
f.token.value = token;
|
||||||
|
|
||||||
return confirm('그누보드4의 DB 데이터를 이전하시겠습니까?');
|
return confirm('그누보드4의 DB 데이터를 이전하시겠습니까?');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+51
-1
@@ -17,6 +17,13 @@ echo '<link rel="stylesheet" href="'.G5_URL.'/g4_import.css">';
|
|||||||
if(empty($_POST))
|
if(empty($_POST))
|
||||||
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
|
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
|
||||||
|
|
||||||
|
if (!preg_match("/^http['s']?:\/\/".$_SERVER['HTTP_HOST']."/", $_SERVER['HTTP_REFERER'])){
|
||||||
|
alert("제대로 된 접근이 아닌것 같습니다.", G5_URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 토큰체크
|
||||||
|
check_write_token('g4_import');
|
||||||
|
|
||||||
if(get_session('tables_copied') == 'done')
|
if(get_session('tables_copied') == 'done')
|
||||||
alert('DB 데이터 변환을 이미 실행하였습니다. 중복 실행시 오류가 발생할 수 있습니다.', G5_URL);
|
alert('DB 데이터 변환을 이미 실행하였습니다. 중복 실행시 오류가 발생할 수 있습니다.', G5_URL);
|
||||||
|
|
||||||
@@ -165,7 +172,7 @@ document.onkeydown = noRefresh ;
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
// g4의 confing.php
|
// g4의 confing.php
|
||||||
require($g4_config_file);
|
require('./'.$g4_config_file);
|
||||||
|
|
||||||
if(preg_replace('/[^a-z]/', '', strtolower($g4['charset'])) == 'euckr')
|
if(preg_replace('/[^a-z]/', '', strtolower($g4['charset'])) == 'euckr')
|
||||||
$is_euckr = true;
|
$is_euckr = true;
|
||||||
@@ -372,9 +379,52 @@ document.onkeydown = noRefresh ;
|
|||||||
$comma = '';
|
$comma = '';
|
||||||
$sql_common = '';
|
$sql_common = '';
|
||||||
|
|
||||||
|
// 모바일 스킨 디렉토리
|
||||||
|
if( ! isset($row['bo_mobile_skin']) ){
|
||||||
|
$row['bo_mobile_skin'] = 'basic';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 모바일 제목 길이
|
||||||
|
if( ! isset($row['bo_mobile_subject_len']) ){
|
||||||
|
$row['bo_mobile_subject_len'] = '30';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 모바일 페이지당 목록 수
|
||||||
|
if( ! isset($row['bo_mobile_page_rows']) ){
|
||||||
|
$row['bo_mobile_page_rows'] = '15';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 갤러리 이미지 폭 ( 리스트 )
|
||||||
|
if( ! isset($row['bo_gallery_width']) ){
|
||||||
|
$row['bo_gallery_width'] = '174';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 갤러리 이미지 높이 ( 리스트 )
|
||||||
|
if( ! isset($row['bo_gallery_height']) ){
|
||||||
|
$row['bo_gallery_height'] = '124';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 모바일 갤러리 이미지 폭 ( 리스트 )
|
||||||
|
if( ! isset($row['bo_mobile_gallery_width']) ){
|
||||||
|
$row['bo_mobile_gallery_width'] = '125';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 모바일 갤러리 이미지 높이 ( 리스트 )
|
||||||
|
if( ! isset($row['bo_mobile_gallery_height']) ){
|
||||||
|
$row['bo_mobile_gallery_height'] = '100';
|
||||||
|
}
|
||||||
|
|
||||||
foreach($row as $key=>$val) {
|
foreach($row as $key=>$val) {
|
||||||
if(!in_array($key, $columns))
|
if(!in_array($key, $columns))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if($key === 'bo_notice'){
|
||||||
|
$val = str_replace("\n", ",", $val);
|
||||||
|
|
||||||
|
if( substr($val, -1) === ',' ){
|
||||||
|
$val = substr($val, 0, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
|
$sql_common .= $comma . " $key = '".addslashes($val)."' ";
|
||||||
|
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ fclose($f);
|
|||||||
// data 디렉토리 및 하위 디렉토리에서는 .htaccess .htpasswd .php .phtml .html .htm .inc .cgi .pl 파일을 실행할수 없게함.
|
// data 디렉토리 및 하위 디렉토리에서는 .htaccess .htpasswd .php .phtml .html .htm .inc .cgi .pl 파일을 실행할수 없게함.
|
||||||
$f = fopen($data_path.'/.htaccess', 'w');
|
$f = fopen($data_path.'/.htaccess', 'w');
|
||||||
$str = <<<EOD
|
$str = <<<EOD
|
||||||
<FilesMatch "\.(htaccess|htpasswd|[Pp][Hh][Pp]|[Pp]?[Hh][Tt][Mm][Ll]?|[Ii][Nn][Cc]|[Cc][Gg][Ii]|[Pp][Ll])">
|
<FilesMatch "\.(htaccess|htpasswd|[Pp][Hh][Pp]|[Pp][Hh][Tt]|[Pp]?[Hh][Tt][Mm][Ll]?|[Ii][Nn][Cc]|[Cc][Gg][Ii]|[Pp][Ll])">
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
Deny from all
|
Deny from all
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
|
|||||||
+8
-1
@@ -69,6 +69,8 @@ function number_format(data)
|
|||||||
var cutlen = 3;
|
var cutlen = 3;
|
||||||
var comma = ',';
|
var comma = ',';
|
||||||
var i;
|
var i;
|
||||||
|
|
||||||
|
data = data + '';
|
||||||
|
|
||||||
var sign = data.match(/^[\+\-]/);
|
var sign = data.match(/^[\+\-]/);
|
||||||
if(sign) {
|
if(sign) {
|
||||||
@@ -721,8 +723,13 @@ function get_write_token(bo_table)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit", function() {
|
$(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit, form[name=fwrite] input:image", function() {
|
||||||
var f = this.form;
|
var f = this.form;
|
||||||
|
|
||||||
|
if (typeof(f.bo_table) == "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var bo_table = f.bo_table.value;
|
var bo_table = f.bo_table.value;
|
||||||
var token = get_write_token(bo_table);
|
var token = get_write_token(bo_table);
|
||||||
|
|
||||||
|
|||||||
+74
-42
@@ -153,7 +153,7 @@ function alert($msg='', $url='', $error=true, $post=false)
|
|||||||
global $g5, $config, $member;
|
global $g5, $config, $member;
|
||||||
global $is_admin;
|
global $is_admin;
|
||||||
|
|
||||||
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
|
$msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.';
|
||||||
|
|
||||||
$header = '';
|
$header = '';
|
||||||
if (isset($g5['title'])) {
|
if (isset($g5['title'])) {
|
||||||
@@ -168,6 +168,8 @@ function alert($msg='', $url='', $error=true, $post=false)
|
|||||||
function alert_close($msg, $error=true)
|
function alert_close($msg, $error=true)
|
||||||
{
|
{
|
||||||
global $g5;
|
global $g5;
|
||||||
|
|
||||||
|
$msg = strip_tags($msg, '<br>');
|
||||||
|
|
||||||
$header = '';
|
$header = '';
|
||||||
if (isset($g5['title'])) {
|
if (isset($g5['title'])) {
|
||||||
@@ -214,11 +216,12 @@ function url_auto_link($str)
|
|||||||
// 140326 유창화님 제안코드로 수정
|
// 140326 유창화님 제안코드로 수정
|
||||||
// http://sir.kr/pg_lecture/461
|
// http://sir.kr/pg_lecture/461
|
||||||
// http://sir.kr/pg_lecture/463
|
// http://sir.kr/pg_lecture/463
|
||||||
|
$attr_nofollow = (function_exists('check_html_link_nofollow') && check_html_link_nofollow('url_auto_link')) ? ' rel="nofollow"' : '';
|
||||||
$str = str_replace(array("<", ">", "&", """, " ", "'"), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t", "'"), $str);
|
$str = str_replace(array("<", ">", "&", """, " ", "'"), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t", "'"), $str);
|
||||||
//$str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "<A HREF=\"\\1\" TARGET='{$config['cf_link_target']}'>\\1</A>", $str);
|
//$str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "<A HREF=\"\\1\" TARGET='{$config['cf_link_target']}'>\\1</A>", $str);
|
||||||
$str = preg_replace("/([^(href=\"?'?)|(src=\"?'?)]|\(|^)((http|https|ftp|telnet|news|mms):\/\/[a-zA-Z0-9\.-]+\.[가-힣\xA1-\xFEa-zA-Z0-9\.:&#!=_\?\/~\+%@;\-\|\,\(\)]+)/i", "\\1<A HREF=\"\\2\" TARGET=\"{$config['cf_link_target']}\">\\2</A>", $str);
|
$str = preg_replace("/([^(href=\"?'?)|(src=\"?'?)]|\(|^)((http|https|ftp|telnet|news|mms):\/\/[a-zA-Z0-9\.-]+\.[가-힣\xA1-\xFEa-zA-Z0-9\.:&#!=_\?\/~\+%@;\-\|\,\(\)]+)/i", "\\1<A HREF=\"\\2\" TARGET=\"{$config['cf_link_target']}\" $attr_nofollow>\\2</A>", $str);
|
||||||
$str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1<A HREF=\"http://\\2\" TARGET=\"{$config['cf_link_target']}\">\\2</A>", $str);
|
$str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1<A HREF=\"http://\\2\" TARGET=\"{$config['cf_link_target']}\" $attr_nofollow>\\2</A>", $str);
|
||||||
$str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "<a href=\"mailto:\\0\">\\0</a>", $str);
|
$str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "<a href=\"mailto:\\0\" $attr_nofollow>\\0</a>", $str);
|
||||||
$str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t", "'"), array(" ", "<", ">", "'"), $str);
|
$str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t", "'"), array(" ", "<", ">", "'"), $str);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -536,6 +539,9 @@ function conv_content($content, $html, $filter=true)
|
|||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_html_link_nofollow($type=''){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// http://htmlpurifier.org/
|
// http://htmlpurifier.org/
|
||||||
// Standards-Compliant HTML Filtering
|
// Standards-Compliant HTML Filtering
|
||||||
@@ -559,6 +565,7 @@ function html_purifier($html)
|
|||||||
$safeiframe = implode('|', $domains);
|
$safeiframe = implode('|', $domains);
|
||||||
|
|
||||||
include_once(G5_PLUGIN_PATH.'/htmlpurifier/HTMLPurifier.standalone.php');
|
include_once(G5_PLUGIN_PATH.'/htmlpurifier/HTMLPurifier.standalone.php');
|
||||||
|
include_once(G5_PLUGIN_PATH.'/htmlpurifier/extend.video.php');
|
||||||
$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');
|
||||||
@@ -566,8 +573,13 @@ function html_purifier($html)
|
|||||||
$config->set('HTML.SafeObject', false);
|
$config->set('HTML.SafeObject', false);
|
||||||
$config->set('Output.FlashCompat', false);
|
$config->set('Output.FlashCompat', false);
|
||||||
$config->set('HTML.SafeIframe', true);
|
$config->set('HTML.SafeIframe', true);
|
||||||
|
if( (function_exists('check_html_link_nofollow') && check_html_link_nofollow('html_purifier')) ){
|
||||||
|
$config->set('HTML.Nofollow', true); // rel=nofollow 으로 스팸유입을 줄임
|
||||||
|
}
|
||||||
$config->set('URI.SafeIframeRegexp','%^(https?:)?//('.$safeiframe.')%');
|
$config->set('URI.SafeIframeRegexp','%^(https?:)?//('.$safeiframe.')%');
|
||||||
$config->set('Attr.AllowedFrameTargets', array('_blank'));
|
$config->set('Attr.AllowedFrameTargets', array('_blank'));
|
||||||
|
//유튜브, 비메오 전체화면 가능하게 하기
|
||||||
|
$config->set('Filter.Custom', array(new HTMLPurifier_Filter_Iframevideo()));
|
||||||
$purifier = new HTMLPurifier($config);
|
$purifier = new HTMLPurifier($config);
|
||||||
return $purifier->purify($html);
|
return $purifier->purify($html);
|
||||||
}
|
}
|
||||||
@@ -1211,8 +1223,8 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
|
|||||||
|
|
||||||
$tmp_name = "";
|
$tmp_name = "";
|
||||||
if ($mb_id) {
|
if ($mb_id) {
|
||||||
//$tmp_name = "<a href=\"".G5_BBS_URL."/profile.php?mb_id=".$mb_id."\" class=\"sv_member\" title=\"$name 자기소개\" target=\"_blank\" onclick=\"return false;\">$name</a>";
|
//$tmp_name = "<a href=\"".G5_BBS_URL."/profile.php?mb_id=".$mb_id."\" class=\"sv_member\" title=\"$name 자기소개\" rel="nofollow" target=\"_blank\" onclick=\"return false;\">$name</a>";
|
||||||
$tmp_name = '<a href="'.G5_BBS_URL.'/profile.php?mb_id='.$mb_id.'" class="sv_member" title="'.$name.' 자기소개" target="_blank" onclick="return false;">';
|
$tmp_name = '<a href="'.G5_BBS_URL.'/profile.php?mb_id='.$mb_id.'" class="sv_member" title="'.$name.' 자기소개" target="_blank" rel="nofollow" onclick="return false;">';
|
||||||
|
|
||||||
if ($config['cf_use_member_icon']) {
|
if ($config['cf_use_member_icon']) {
|
||||||
$mb_dir = substr($mb_id,0,2);
|
$mb_dir = substr($mb_id,0,2);
|
||||||
@@ -1239,7 +1251,7 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
|
|||||||
if(!$bo_table)
|
if(!$bo_table)
|
||||||
return $name;
|
return $name;
|
||||||
|
|
||||||
$tmp_name = '<a href="'.G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&sca='.$sca.'&sfl=wr_name,1&stx='.$name.'" title="'.$name.' 이름으로 검색" class="sv_guest" onclick="return false;">'.$name.'</a>';
|
$tmp_name = '<a href="'.G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&sca='.$sca.'&sfl=wr_name,1&stx='.$name.'" title="'.$name.' 이름으로 검색" class="sv_guest" rel="nofollow" onclick="return false;">'.$name.'</a>';
|
||||||
$title_mb_id = '[비회원]';
|
$title_mb_id = '[비회원]';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2019,8 +2031,12 @@ function sql_real_escape_string($str, $link=null)
|
|||||||
|
|
||||||
if(!$link)
|
if(!$link)
|
||||||
$link = $g5['connect_db'];
|
$link = $g5['connect_db'];
|
||||||
|
|
||||||
|
if(function_exists('mysqli_connect') && G5_MYSQLI_USE) {
|
||||||
|
return mysqli_real_escape_string($link, $str);
|
||||||
|
}
|
||||||
|
|
||||||
return mysqli_real_escape_string($link, $str);
|
return mysql_real_escape_string($str, $link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function escape_trim($field)
|
function escape_trim($field)
|
||||||
@@ -2131,6 +2147,10 @@ function check_device($device)
|
|||||||
// 게시판 최신글 캐시 파일 삭제
|
// 게시판 최신글 캐시 파일 삭제
|
||||||
function delete_cache_latest($bo_table)
|
function delete_cache_latest($bo_table)
|
||||||
{
|
{
|
||||||
|
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$files = glob(G5_DATA_PATH.'/cache/latest-'.$bo_table.'-*');
|
$files = glob(G5_DATA_PATH.'/cache/latest-'.$bo_table.'-*');
|
||||||
if (is_array($files)) {
|
if (is_array($files)) {
|
||||||
foreach ($files as $filename)
|
foreach ($files as $filename)
|
||||||
@@ -2932,9 +2952,13 @@ function replace_filename($name)
|
|||||||
@session_start();
|
@session_start();
|
||||||
$ss_id = session_id();
|
$ss_id = session_id();
|
||||||
$usec = get_microtime();
|
$usec = get_microtime();
|
||||||
$ext = array_pop(explode('.', $name));
|
$file_path = pathinfo($name);
|
||||||
|
$ext = $file_path['extension'];
|
||||||
|
$return_filename = sha1($ss_id.$_SERVER['REMOTE_ADDR'].$usec);
|
||||||
|
if( $ext )
|
||||||
|
$return_filename .= '.'.$ext;
|
||||||
|
|
||||||
return sha1($ss_id.$_SERVER['REMOTE_ADDR'].$usec).'.'.$ext;
|
return $return_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 아이코드 사용자정보
|
// 아이코드 사용자정보
|
||||||
@@ -3302,46 +3326,54 @@ function get_call_func_cache($func, $args=array()){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다.
|
// include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다.
|
||||||
function is_include_path_check($path='')
|
function is_include_path_check($path='', $is_input='')
|
||||||
{
|
{
|
||||||
if( $path ){
|
if( $path ){
|
||||||
try {
|
if ($is_input){
|
||||||
// whether $path is unix or not
|
try {
|
||||||
$unipath = strlen($path)==0 || $path{0}!='/';
|
// whether $path is unix or not
|
||||||
$unc = substr($path,0,2)=='\\\\'?true:false;
|
$unipath = strlen($path)==0 || $path{0}!='/';
|
||||||
// attempts to detect if path is relative in which case, add cwd
|
$unc = substr($path,0,2)=='\\\\'?true:false;
|
||||||
if(strpos($path,':') === false && $unipath && !$unc){
|
// attempts to detect if path is relative in which case, add cwd
|
||||||
$path=getcwd().DIRECTORY_SEPARATOR.$path;
|
if(strpos($path,':') === false && $unipath && !$unc){
|
||||||
if($path{0}=='/'){
|
$path=getcwd().DIRECTORY_SEPARATOR.$path;
|
||||||
$unipath = false;
|
if($path{0}=='/'){
|
||||||
|
$unipath = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// resolve path parts (single dot, double dot and double delimiters)
|
||||||
|
$path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
|
||||||
|
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
|
||||||
|
$absolutes = array();
|
||||||
|
foreach ($parts as $part) {
|
||||||
|
if ('.' == $part){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ('..' == $part) {
|
||||||
|
array_pop($absolutes);
|
||||||
|
} else {
|
||||||
|
$absolutes[] = $part;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$path = implode(DIRECTORY_SEPARATOR, $absolutes);
|
||||||
|
// resolve any symlinks
|
||||||
|
// put initial separator that could have been lost
|
||||||
|
$path = !$unipath ? '/'.$path : $path;
|
||||||
|
$path = $unc ? '\\\\'.$path : $path;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
//echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolve path parts (single dot, double dot and double delimiters)
|
if( preg_match('/\/data\/(file|editor)\/[A-Za-z0-9_]{1,20}\//', $path) ){
|
||||||
$path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
|
return false;
|
||||||
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
|
|
||||||
$absolutes = array();
|
|
||||||
foreach ($parts as $part) {
|
|
||||||
if ('.' == $part){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ('..' == $part) {
|
|
||||||
array_pop($absolutes);
|
|
||||||
} else {
|
|
||||||
$absolutes[] = $part;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$path = implode(DIRECTORY_SEPARATOR, $absolutes);
|
|
||||||
// resolve any symlinks
|
|
||||||
// put initial separator that could have been lost
|
|
||||||
$path = !$unipath ? '/'.$path : $path;
|
|
||||||
$path = $unc ? '\\\\'.$path : $path;
|
|
||||||
} catch (Exception $e) {
|
|
||||||
//echo 'Caught exception: ', $e->getMessage(), "\n";
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( preg_match('/\/data\/(file|editor)\/[A-Za-z0-9_]{1,20}\//', $path) ){
|
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||||
|
|
||||||
|
if($extension && preg_match('/(jpg|jpeg|png|gif|bmp|conf)$/', $extension)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-6
@@ -284,6 +284,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
|||||||
|
|
||||||
$is_large = true;
|
$is_large = true;
|
||||||
// width, height 설정
|
// width, height 설정
|
||||||
|
|
||||||
if($thumb_width) {
|
if($thumb_width) {
|
||||||
if(!$thumb_height) {
|
if(!$thumb_height) {
|
||||||
$thumb_height = round(($thumb_width * $size[1]) / $size[0]);
|
$thumb_height = round(($thumb_width * $size[1]) / $size[0]);
|
||||||
@@ -348,7 +349,6 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
|||||||
} else { // 비율에 맞게 생성
|
} else { // 비율에 맞게 생성
|
||||||
$dst = imagecreatetruecolor($dst_w, $dst_h);
|
$dst = imagecreatetruecolor($dst_w, $dst_h);
|
||||||
$bgcolor = imagecolorallocate($dst, 255, 255, 255); // 배경색
|
$bgcolor = imagecolorallocate($dst, 255, 255, 255); // 배경색
|
||||||
|
|
||||||
if($src_w > $src_h) {
|
if($src_w > $src_h) {
|
||||||
$tmp_h = round(($dst_w * $src_h) / $src_w);
|
$tmp_h = round(($dst_w * $src_h) / $src_w);
|
||||||
$dst_y = round(($dst_h - $tmp_h) / 2);
|
$dst_y = round(($dst_h - $tmp_h) / 2);
|
||||||
@@ -384,8 +384,14 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
|||||||
|
|
||||||
if($src_w < $dst_w) {
|
if($src_w < $dst_w) {
|
||||||
if($src_h >= $dst_h) {
|
if($src_h >= $dst_h) {
|
||||||
$dst_x = round(($dst_w - $src_w) / 2);
|
if( $src_h > $src_w ){
|
||||||
$src_h = $dst_h;
|
$tmp_w = round(($dst_h * $src_w) / $src_h);
|
||||||
|
$dst_x = round(($dst_w - $tmp_w) / 2);
|
||||||
|
$dst_w = $tmp_w;
|
||||||
|
} else {
|
||||||
|
$dst_x = round(($dst_w - $src_w) / 2);
|
||||||
|
$src_h = $dst_h;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$dst_x = round(($dst_w - $src_w) / 2);
|
$dst_x = round(($dst_w - $src_w) / 2);
|
||||||
$dst_y = round(($dst_h - $src_h) / 2);
|
$dst_y = round(($dst_h - $src_h) / 2);
|
||||||
@@ -394,9 +400,15 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if($src_h < $dst_h) {
|
if($src_h < $dst_h) {
|
||||||
$dst_y = round(($dst_h - $src_h) / 2);
|
if( $src_w > $dst_w ){
|
||||||
$dst_h = $src_h;
|
$tmp_h = round(($dst_w * $src_h) / $src_w);
|
||||||
$src_w = $dst_w;
|
$dst_y = round(($dst_h - $tmp_h) / 2);
|
||||||
|
$dst_h = $tmp_h;
|
||||||
|
} else {
|
||||||
|
$dst_y = round(($dst_h - $src_h) / 2);
|
||||||
|
$dst_h = $src_h;
|
||||||
|
$src_w = $dst_w;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,15 @@ add_stylesheet('<link rel="stylesheet" href="'.$popular_skin_url.'/style.css">',
|
|||||||
<div>
|
<div>
|
||||||
<h2>인기검색어</h2>
|
<h2>인기검색어</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<?php for ($i=0; $i<count($list); $i++) { ?>
|
<?php
|
||||||
|
if( isset($list) && is_array($list) ){
|
||||||
|
for ($i=0; $i<count($list); $i++) {
|
||||||
|
?>
|
||||||
<li><a href="<?php echo G5_BBS_URL ?>/search.php?sfl=wr_subject&sop=and&stx=<?php echo urlencode($list[$i]['pp_word']) ?>"><?php echo get_text($list[$i]['pp_word']); ?></a></li>
|
<li><a href="<?php echo G5_BBS_URL ?>/search.php?sfl=wr_subject&sop=and&stx=<?php echo urlencode($list[$i]['pp_word']) ?>"><?php echo get_text($list[$i]['pp_word']); ?></a></li>
|
||||||
<?php } ?>
|
<?php
|
||||||
|
} //end for
|
||||||
|
} //end if
|
||||||
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
@@ -48,8 +48,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./js/jquery-1.8.3.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||||
<script src="./js/jquery-ui.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
|
||||||
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
|
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
|
||||||
<script src="./js/jquery.iframe-transport.js"></script>
|
<script src="./js/jquery.iframe-transport.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! jQuery v1.8.3 jquery.com | jquery.org/license */
|
|
||||||
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]Line truncated
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/*! jQuery UI - v1.10.1 - 2013-02-15
|
|
||||||
* http://jqueryui.com
|
|
||||||
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
|
|
||||||
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
|
|
||||||
(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.10.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)}})})(jQuery),function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=tLine truncated
|
|
||||||
+22476
-22097
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
|
//https://stackoverflow.com/questions/4739284/htmlpurifier-iframe-vimeo-and-youtube-video
|
||||||
|
/**
|
||||||
|
* Based on: http://sachachua.com/blog/2011/08/drupal-html-purifier-embedding-iframes-youtube/
|
||||||
|
* Iframe filter that does some primitive whitelisting in a somewhat recognizable and tweakable way
|
||||||
|
*/
|
||||||
|
|
||||||
|
if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
|
||||||
|
class HTMLPurifier_Filter_iframevideo extends HTMLPurifier_Filter
|
||||||
|
{
|
||||||
|
public $name = 'Iframevideo';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $html
|
||||||
|
* @param HTMLPurifier_Config $config
|
||||||
|
* @param HTMLPurifier_Context $context
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function preFilter($html, $config, $context)
|
||||||
|
{
|
||||||
|
$html = preg_replace('#<iframe#i', '<img class="Iframevideo"', $html);
|
||||||
|
$html = preg_replace('#</iframe>#i', '</img>', $html);
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param string $html
|
||||||
|
* @param HTMLPurifier_Config $config
|
||||||
|
* @param HTMLPurifier_Context $context
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function postFilter($html, $config, $context)
|
||||||
|
{
|
||||||
|
$post_regex = '#<img class="Iframevideo"([^>]+?)>#';
|
||||||
|
return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param array $matches
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function postFilterCallback($matches)
|
||||||
|
{
|
||||||
|
// Domain Whitelist
|
||||||
|
$youTubeMatch = preg_match('#src="https?://www.youtube(-nocookie)?.com/#i', $matches[1]);
|
||||||
|
$vimeoMatch = preg_match('#src="http://player.vimeo.com/#i', $matches[1]);
|
||||||
|
if ($youTubeMatch || $vimeoMatch) {
|
||||||
|
$extra = ' frameborder="0"';
|
||||||
|
if ($youTubeMatch) {
|
||||||
|
$extra .= ' allowfullscreen';
|
||||||
|
} elseif ($vimeoMatch) {
|
||||||
|
$extra .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen';
|
||||||
|
}
|
||||||
|
return '<iframe ' . $matches[1] . $extra . '></iframe>';
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -1,48 +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
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
||||||
* @return HTMLPurifier_ConfigSchema
|
* @return HTMLPurifier_ConfigSchema
|
||||||
*/
|
*/
|
||||||
public function build($interchange)
|
public function build($interchange)
|
||||||
{
|
{
|
||||||
$schema = new HTMLPurifier_ConfigSchema();
|
$schema = new HTMLPurifier_ConfigSchema();
|
||||||
foreach ($interchange->directives as $d) {
|
foreach ($interchange->directives as $d) {
|
||||||
$schema->add(
|
$schema->add(
|
||||||
$d->id->key,
|
$d->id->key,
|
||||||
$d->default,
|
$d->default,
|
||||||
$d->type,
|
$d->type,
|
||||||
$d->typeAllowsNull
|
$d->typeAllowsNull
|
||||||
);
|
);
|
||||||
if ($d->allowed !== null) {
|
if ($d->allowed !== null) {
|
||||||
$schema->addAllowedValues(
|
$schema->addAllowedValues(
|
||||||
$d->id->key,
|
$d->id->key,
|
||||||
$d->allowed
|
$d->allowed
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
foreach ($d->aliases as $alias) {
|
foreach ($d->aliases as $alias) {
|
||||||
$schema->addAlias(
|
$schema->addAlias(
|
||||||
$alias->key,
|
$alias->key,
|
||||||
$d->id->key
|
$d->id->key
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($d->valueAliases !== null) {
|
if ($d->valueAliases !== null) {
|
||||||
$schema->addValueAliases(
|
$schema->addValueAliases(
|
||||||
$d->id->key,
|
$d->id->key,
|
||||||
$d->valueAliases
|
$d->valueAliases
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$schema->postProcess();
|
$schema->postProcess();
|
||||||
return $schema;
|
return $schema;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
@@ -1,144 +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
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type HTMLPurifier_ConfigSchema_Interchange
|
* @type HTMLPurifier_ConfigSchema_Interchange
|
||||||
*/
|
*/
|
||||||
protected $interchange;
|
protected $interchange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
private $namespace;
|
private $namespace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $html
|
* @param string $html
|
||||||
*/
|
*/
|
||||||
protected function writeHTMLDiv($html)
|
protected function writeHTMLDiv($html)
|
||||||
{
|
{
|
||||||
$this->startElement('div');
|
$this->startElement('div');
|
||||||
|
|
||||||
$purifier = HTMLPurifier::getInstance();
|
$purifier = HTMLPurifier::getInstance();
|
||||||
$html = $purifier->purify($html);
|
$html = $purifier->purify($html);
|
||||||
$this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
|
$this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
|
||||||
$this->writeRaw($html);
|
$this->writeRaw($html);
|
||||||
|
|
||||||
$this->endElement(); // div
|
$this->endElement(); // div
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $var
|
* @param mixed $var
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function export($var)
|
protected function export($var)
|
||||||
{
|
{
|
||||||
if ($var === array()) {
|
if ($var === array()) {
|
||||||
return 'array()';
|
return 'array()';
|
||||||
}
|
}
|
||||||
return var_export($var, true);
|
return var_export($var, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
||||||
*/
|
*/
|
||||||
public function build($interchange)
|
public function build($interchange)
|
||||||
{
|
{
|
||||||
// global access, only use as last resort
|
// global access, only use as last resort
|
||||||
$this->interchange = $interchange;
|
$this->interchange = $interchange;
|
||||||
|
|
||||||
$this->setIndent(true);
|
$this->setIndent(true);
|
||||||
$this->startDocument('1.0', 'UTF-8');
|
$this->startDocument('1.0', 'UTF-8');
|
||||||
$this->startElement('configdoc');
|
$this->startElement('configdoc');
|
||||||
$this->writeElement('title', $interchange->name);
|
$this->writeElement('title', $interchange->name);
|
||||||
|
|
||||||
foreach ($interchange->directives as $directive) {
|
foreach ($interchange->directives as $directive) {
|
||||||
$this->buildDirective($directive);
|
$this->buildDirective($directive);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->namespace) {
|
if ($this->namespace) {
|
||||||
$this->endElement();
|
$this->endElement();
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
$this->endElement(); // configdoc
|
$this->endElement(); // configdoc
|
||||||
$this->flush();
|
$this->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive
|
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive
|
||||||
*/
|
*/
|
||||||
public function buildDirective($directive)
|
public function buildDirective($directive)
|
||||||
{
|
{
|
||||||
// Kludge, although I suppose having a notion of a "root namespace"
|
// Kludge, although I suppose having a notion of a "root namespace"
|
||||||
// certainly makes things look nicer when documentation is built.
|
// certainly makes things look nicer when documentation is built.
|
||||||
// Depends on things being sorted.
|
// Depends on things being sorted.
|
||||||
if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) {
|
if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) {
|
||||||
if ($this->namespace) {
|
if ($this->namespace) {
|
||||||
$this->endElement();
|
$this->endElement();
|
||||||
} // namespace
|
} // namespace
|
||||||
$this->namespace = $directive->id->getRootNamespace();
|
$this->namespace = $directive->id->getRootNamespace();
|
||||||
$this->startElement('namespace');
|
$this->startElement('namespace');
|
||||||
$this->writeAttribute('id', $this->namespace);
|
$this->writeAttribute('id', $this->namespace);
|
||||||
$this->writeElement('name', $this->namespace);
|
$this->writeElement('name', $this->namespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->startElement('directive');
|
$this->startElement('directive');
|
||||||
$this->writeAttribute('id', $directive->id->toString());
|
$this->writeAttribute('id', $directive->id->toString());
|
||||||
|
|
||||||
$this->writeElement('name', $directive->id->getDirective());
|
$this->writeElement('name', $directive->id->getDirective());
|
||||||
|
|
||||||
$this->startElement('aliases');
|
$this->startElement('aliases');
|
||||||
foreach ($directive->aliases as $alias) {
|
foreach ($directive->aliases as $alias) {
|
||||||
$this->writeElement('alias', $alias->toString());
|
$this->writeElement('alias', $alias->toString());
|
||||||
}
|
}
|
||||||
$this->endElement(); // aliases
|
$this->endElement(); // aliases
|
||||||
|
|
||||||
$this->startElement('constraints');
|
$this->startElement('constraints');
|
||||||
if ($directive->version) {
|
if ($directive->version) {
|
||||||
$this->writeElement('version', $directive->version);
|
$this->writeElement('version', $directive->version);
|
||||||
}
|
}
|
||||||
$this->startElement('type');
|
$this->startElement('type');
|
||||||
if ($directive->typeAllowsNull) {
|
if ($directive->typeAllowsNull) {
|
||||||
$this->writeAttribute('allow-null', 'yes');
|
$this->writeAttribute('allow-null', 'yes');
|
||||||
}
|
}
|
||||||
$this->text($directive->type);
|
$this->text($directive->type);
|
||||||
$this->endElement(); // type
|
$this->endElement(); // type
|
||||||
if ($directive->allowed) {
|
if ($directive->allowed) {
|
||||||
$this->startElement('allowed');
|
$this->startElement('allowed');
|
||||||
foreach ($directive->allowed as $value => $x) {
|
foreach ($directive->allowed as $value => $x) {
|
||||||
$this->writeElement('value', $value);
|
$this->writeElement('value', $value);
|
||||||
}
|
}
|
||||||
$this->endElement(); // allowed
|
$this->endElement(); // allowed
|
||||||
}
|
}
|
||||||
$this->writeElement('default', $this->export($directive->default));
|
$this->writeElement('default', $this->export($directive->default));
|
||||||
$this->writeAttribute('xml:space', 'preserve');
|
$this->writeAttribute('xml:space', 'preserve');
|
||||||
if ($directive->external) {
|
if ($directive->external) {
|
||||||
$this->startElement('external');
|
$this->startElement('external');
|
||||||
foreach ($directive->external as $project) {
|
foreach ($directive->external as $project) {
|
||||||
$this->writeElement('project', $project);
|
$this->writeElement('project', $project);
|
||||||
}
|
}
|
||||||
$this->endElement();
|
$this->endElement();
|
||||||
}
|
}
|
||||||
$this->endElement(); // constraints
|
$this->endElement(); // constraints
|
||||||
|
|
||||||
if ($directive->deprecatedVersion) {
|
if ($directive->deprecatedVersion) {
|
||||||
$this->startElement('deprecated');
|
$this->startElement('deprecated');
|
||||||
$this->writeElement('version', $directive->deprecatedVersion);
|
$this->writeElement('version', $directive->deprecatedVersion);
|
||||||
$this->writeElement('use', $directive->deprecatedUse->toString());
|
$this->writeElement('use', $directive->deprecatedUse->toString());
|
||||||
$this->endElement(); // deprecated
|
$this->endElement(); // deprecated
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->startElement('description');
|
$this->startElement('description');
|
||||||
$this->writeHTMLDiv($directive->description);
|
$this->writeHTMLDiv($directive->description);
|
||||||
$this->endElement(); // description
|
$this->endElement(); // description
|
||||||
|
|
||||||
$this->endElement(); // directive
|
$this->endElement(); // directive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// 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,47 +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
|
* @type string
|
||||||
*/
|
*/
|
||||||
public $name;
|
public $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of Directive ID => array(directive info)
|
* Array of Directive ID => array(directive info)
|
||||||
* @type HTMLPurifier_ConfigSchema_Interchange_Directive[]
|
* @type HTMLPurifier_ConfigSchema_Interchange_Directive[]
|
||||||
*/
|
*/
|
||||||
public $directives = array();
|
public $directives = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a directive array to $directives
|
* Adds a directive array to $directives
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive
|
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive
|
||||||
* @throws HTMLPurifier_ConfigSchema_Exception
|
* @throws HTMLPurifier_ConfigSchema_Exception
|
||||||
*/
|
*/
|
||||||
public function addDirective($directive)
|
public function addDirective($directive)
|
||||||
{
|
{
|
||||||
if (isset($this->directives[$i = $directive->id->toString()])) {
|
if (isset($this->directives[$i = $directive->id->toString()])) {
|
||||||
throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'");
|
throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'");
|
||||||
}
|
}
|
||||||
$this->directives[$i] = $directive;
|
$this->directives[$i] = $directive;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function to perform standard validation. Throws exception
|
* Convenience function to perform standard validation. Throws exception
|
||||||
* on failed validation.
|
* on failed validation.
|
||||||
*/
|
*/
|
||||||
public function validate()
|
public function validate()
|
||||||
{
|
{
|
||||||
$validator = new HTMLPurifier_ConfigSchema_Validator();
|
$validator = new HTMLPurifier_ConfigSchema_Validator();
|
||||||
return $validator->validate($this);
|
return $validator->validate($this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
+89
-89
@@ -1,89 +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.
|
* ID of directive.
|
||||||
* @type HTMLPurifier_ConfigSchema_Interchange_Id
|
* @type HTMLPurifier_ConfigSchema_Interchange_Id
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type, e.g. 'integer' or 'istring'.
|
* Type, e.g. 'integer' or 'istring'.
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
public $type;
|
public $type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default value, e.g. 3 or 'DefaultVal'.
|
* Default value, e.g. 3 or 'DefaultVal'.
|
||||||
* @type mixed
|
* @type mixed
|
||||||
*/
|
*/
|
||||||
public $default;
|
public $default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTML description.
|
* HTML description.
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not null is allowed as a value.
|
* Whether or not null is allowed as a value.
|
||||||
* @type bool
|
* @type bool
|
||||||
*/
|
*/
|
||||||
public $typeAllowsNull = false;
|
public $typeAllowsNull = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lookup table of allowed scalar values.
|
* Lookup table of allowed scalar values.
|
||||||
* e.g. array('allowed' => true).
|
* e.g. array('allowed' => true).
|
||||||
* Null if all values are allowed.
|
* Null if all values are allowed.
|
||||||
* @type array
|
* @type array
|
||||||
*/
|
*/
|
||||||
public $allowed;
|
public $allowed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of aliases for the directive.
|
* List of aliases for the directive.
|
||||||
* e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))).
|
* e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))).
|
||||||
* @type HTMLPurifier_ConfigSchema_Interchange_Id[]
|
* @type HTMLPurifier_ConfigSchema_Interchange_Id[]
|
||||||
*/
|
*/
|
||||||
public $aliases = array();
|
public $aliases = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hash of value aliases, e.g. array('alt' => 'real'). Null if value
|
* Hash of value aliases, e.g. array('alt' => 'real'). Null if value
|
||||||
* aliasing is disabled (necessary for non-scalar types).
|
* aliasing is disabled (necessary for non-scalar types).
|
||||||
* @type array
|
* @type array
|
||||||
*/
|
*/
|
||||||
public $valueAliases;
|
public $valueAliases;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version of HTML Purifier the directive was introduced, e.g. '1.3.1'.
|
* Version of HTML Purifier the directive was introduced, e.g. '1.3.1'.
|
||||||
* Null if the directive has always existed.
|
* Null if the directive has always existed.
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
public $version;
|
public $version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of directive that supercedes this old directive.
|
* ID of directive that supercedes this old directive.
|
||||||
* Null if not deprecated.
|
* Null if not deprecated.
|
||||||
* @type HTMLPurifier_ConfigSchema_Interchange_Id
|
* @type HTMLPurifier_ConfigSchema_Interchange_Id
|
||||||
*/
|
*/
|
||||||
public $deprecatedUse;
|
public $deprecatedUse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version of HTML Purifier this directive was deprecated. Null if not
|
* Version of HTML Purifier this directive was deprecated. Null if not
|
||||||
* deprecated.
|
* deprecated.
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
public $deprecatedVersion;
|
public $deprecatedVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of external projects this directive depends on, e.g. array('CSSTidy').
|
* List of external projects this directive depends on, e.g. array('CSSTidy').
|
||||||
* @type array
|
* @type array
|
||||||
*/
|
*/
|
||||||
public $external = array();
|
public $external = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
@@ -1,58 +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
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
public $key;
|
public $key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $key
|
* @param string $key
|
||||||
*/
|
*/
|
||||||
public function __construct($key)
|
public function __construct($key)
|
||||||
{
|
{
|
||||||
$this->key = $key;
|
$this->key = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
* @warning This is NOT magic, to ensure that people don't abuse SPL and
|
* @warning This is NOT magic, to ensure that people don't abuse SPL and
|
||||||
* cause problems for PHP 5.0 support.
|
* cause problems for PHP 5.0 support.
|
||||||
*/
|
*/
|
||||||
public function toString()
|
public function toString()
|
||||||
{
|
{
|
||||||
return $this->key;
|
return $this->key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getRootNamespace()
|
public function getRootNamespace()
|
||||||
{
|
{
|
||||||
return substr($this->key, 0, strpos($this->key, "."));
|
return substr($this->key, 0, strpos($this->key, "."));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getDirective()
|
public function getDirective()
|
||||||
{
|
{
|
||||||
return substr($this->key, strpos($this->key, ".") + 1);
|
return substr($this->key, strpos($this->key, ".") + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $id
|
* @param string $id
|
||||||
* @return HTMLPurifier_ConfigSchema_Interchange_Id
|
* @return HTMLPurifier_ConfigSchema_Interchange_Id
|
||||||
*/
|
*/
|
||||||
public static function make($id)
|
public static function make($id)
|
||||||
{
|
{
|
||||||
return new HTMLPurifier_ConfigSchema_Interchange_Id($id);
|
return new HTMLPurifier_ConfigSchema_Interchange_Id($id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
@@ -1,226 +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
|
* @type HTMLPurifier_VarParser
|
||||||
*/
|
*/
|
||||||
protected $varParser;
|
protected $varParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_VarParser $varParser
|
* @param HTMLPurifier_VarParser $varParser
|
||||||
*/
|
*/
|
||||||
public function __construct($varParser = null)
|
public function __construct($varParser = null)
|
||||||
{
|
{
|
||||||
$this->varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native();
|
$this->varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $dir
|
* @param string $dir
|
||||||
* @return HTMLPurifier_ConfigSchema_Interchange
|
* @return HTMLPurifier_ConfigSchema_Interchange
|
||||||
*/
|
*/
|
||||||
public static function buildFromDirectory($dir = null)
|
public static function buildFromDirectory($dir = null)
|
||||||
{
|
{
|
||||||
$builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
|
$builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
|
||||||
$interchange = new HTMLPurifier_ConfigSchema_Interchange();
|
$interchange = new HTMLPurifier_ConfigSchema_Interchange();
|
||||||
return $builder->buildDir($interchange, $dir);
|
return $builder->buildDir($interchange, $dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
||||||
* @param string $dir
|
* @param string $dir
|
||||||
* @return HTMLPurifier_ConfigSchema_Interchange
|
* @return HTMLPurifier_ConfigSchema_Interchange
|
||||||
*/
|
*/
|
||||||
public function buildDir($interchange, $dir = null)
|
public function buildDir($interchange, $dir = null)
|
||||||
{
|
{
|
||||||
if (!$dir) {
|
if (!$dir) {
|
||||||
$dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema';
|
$dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema';
|
||||||
}
|
}
|
||||||
if (file_exists($dir . '/info.ini')) {
|
if (file_exists($dir . '/info.ini')) {
|
||||||
$info = parse_ini_file($dir . '/info.ini');
|
$info = parse_ini_file($dir . '/info.ini');
|
||||||
$interchange->name = $info['name'];
|
$interchange->name = $info['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
$dh = opendir($dir);
|
$dh = opendir($dir);
|
||||||
while (false !== ($file = readdir($dh))) {
|
while (false !== ($file = readdir($dh))) {
|
||||||
if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') {
|
if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
}
|
}
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
|
|
||||||
sort($files);
|
sort($files);
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
$this->buildFile($interchange, $dir . '/' . $file);
|
$this->buildFile($interchange, $dir . '/' . $file);
|
||||||
}
|
}
|
||||||
return $interchange;
|
return $interchange;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
||||||
* @param string $file
|
* @param string $file
|
||||||
*/
|
*/
|
||||||
public function buildFile($interchange, $file)
|
public function buildFile($interchange, $file)
|
||||||
{
|
{
|
||||||
$parser = new HTMLPurifier_StringHashParser();
|
$parser = new HTMLPurifier_StringHashParser();
|
||||||
$this->build(
|
$this->build(
|
||||||
$interchange,
|
$interchange,
|
||||||
new HTMLPurifier_StringHash($parser->parseFile($file))
|
new HTMLPurifier_StringHash($parser->parseFile($file))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds an interchange object based on a hash.
|
* Builds an interchange object based on a hash.
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange HTMLPurifier_ConfigSchema_Interchange object to build
|
* @param HTMLPurifier_ConfigSchema_Interchange $interchange HTMLPurifier_ConfigSchema_Interchange object to build
|
||||||
* @param HTMLPurifier_StringHash $hash source data
|
* @param HTMLPurifier_StringHash $hash source data
|
||||||
* @throws HTMLPurifier_ConfigSchema_Exception
|
* @throws HTMLPurifier_ConfigSchema_Exception
|
||||||
*/
|
*/
|
||||||
public function build($interchange, $hash)
|
public function build($interchange, $hash)
|
||||||
{
|
{
|
||||||
if (!$hash instanceof HTMLPurifier_StringHash) {
|
if (!$hash instanceof HTMLPurifier_StringHash) {
|
||||||
$hash = new HTMLPurifier_StringHash($hash);
|
$hash = new HTMLPurifier_StringHash($hash);
|
||||||
}
|
}
|
||||||
if (!isset($hash['ID'])) {
|
if (!isset($hash['ID'])) {
|
||||||
throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID');
|
throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID');
|
||||||
}
|
}
|
||||||
if (strpos($hash['ID'], '.') === false) {
|
if (strpos($hash['ID'], '.') === false) {
|
||||||
if (count($hash) == 2 && isset($hash['DESCRIPTION'])) {
|
if (count($hash) == 2 && isset($hash['DESCRIPTION'])) {
|
||||||
$hash->offsetGet('DESCRIPTION'); // prevent complaining
|
$hash->offsetGet('DESCRIPTION'); // prevent complaining
|
||||||
} else {
|
} else {
|
||||||
throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace');
|
throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->buildDirective($interchange, $hash);
|
$this->buildDirective($interchange, $hash);
|
||||||
}
|
}
|
||||||
$this->_findUnused($hash);
|
$this->_findUnused($hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
||||||
* @param HTMLPurifier_StringHash $hash
|
* @param HTMLPurifier_StringHash $hash
|
||||||
* @throws HTMLPurifier_ConfigSchema_Exception
|
* @throws HTMLPurifier_ConfigSchema_Exception
|
||||||
*/
|
*/
|
||||||
public function buildDirective($interchange, $hash)
|
public function buildDirective($interchange, $hash)
|
||||||
{
|
{
|
||||||
$directive = new HTMLPurifier_ConfigSchema_Interchange_Directive();
|
$directive = new HTMLPurifier_ConfigSchema_Interchange_Directive();
|
||||||
|
|
||||||
// These are required elements:
|
// These are required elements:
|
||||||
$directive->id = $this->id($hash->offsetGet('ID'));
|
$directive->id = $this->id($hash->offsetGet('ID'));
|
||||||
$id = $directive->id->toString(); // convenience
|
$id = $directive->id->toString(); // convenience
|
||||||
|
|
||||||
if (isset($hash['TYPE'])) {
|
if (isset($hash['TYPE'])) {
|
||||||
$type = explode('/', $hash->offsetGet('TYPE'));
|
$type = explode('/', $hash->offsetGet('TYPE'));
|
||||||
if (isset($type[1])) {
|
if (isset($type[1])) {
|
||||||
$directive->typeAllowsNull = true;
|
$directive->typeAllowsNull = true;
|
||||||
}
|
}
|
||||||
$directive->type = $type[0];
|
$directive->type = $type[0];
|
||||||
} else {
|
} else {
|
||||||
throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined");
|
throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['DEFAULT'])) {
|
if (isset($hash['DEFAULT'])) {
|
||||||
try {
|
try {
|
||||||
$directive->default = $this->varParser->parse(
|
$directive->default = $this->varParser->parse(
|
||||||
$hash->offsetGet('DEFAULT'),
|
$hash->offsetGet('DEFAULT'),
|
||||||
$directive->type,
|
$directive->type,
|
||||||
$directive->typeAllowsNull
|
$directive->typeAllowsNull
|
||||||
);
|
);
|
||||||
} catch (HTMLPurifier_VarParserException $e) {
|
} catch (HTMLPurifier_VarParserException $e) {
|
||||||
throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'");
|
throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['DESCRIPTION'])) {
|
if (isset($hash['DESCRIPTION'])) {
|
||||||
$directive->description = $hash->offsetGet('DESCRIPTION');
|
$directive->description = $hash->offsetGet('DESCRIPTION');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['ALLOWED'])) {
|
if (isset($hash['ALLOWED'])) {
|
||||||
$directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED')));
|
$directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED')));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['VALUE-ALIASES'])) {
|
if (isset($hash['VALUE-ALIASES'])) {
|
||||||
$directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES'));
|
$directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['ALIASES'])) {
|
if (isset($hash['ALIASES'])) {
|
||||||
$raw_aliases = trim($hash->offsetGet('ALIASES'));
|
$raw_aliases = trim($hash->offsetGet('ALIASES'));
|
||||||
$aliases = preg_split('/\s*,\s*/', $raw_aliases);
|
$aliases = preg_split('/\s*,\s*/', $raw_aliases);
|
||||||
foreach ($aliases as $alias) {
|
foreach ($aliases as $alias) {
|
||||||
$directive->aliases[] = $this->id($alias);
|
$directive->aliases[] = $this->id($alias);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['VERSION'])) {
|
if (isset($hash['VERSION'])) {
|
||||||
$directive->version = $hash->offsetGet('VERSION');
|
$directive->version = $hash->offsetGet('VERSION');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['DEPRECATED-USE'])) {
|
if (isset($hash['DEPRECATED-USE'])) {
|
||||||
$directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE'));
|
$directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['DEPRECATED-VERSION'])) {
|
if (isset($hash['DEPRECATED-VERSION'])) {
|
||||||
$directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION');
|
$directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($hash['EXTERNAL'])) {
|
if (isset($hash['EXTERNAL'])) {
|
||||||
$directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL')));
|
$directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$interchange->addDirective($directive);
|
$interchange->addDirective($directive);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluates an array PHP code string without array() wrapper
|
* Evaluates an array PHP code string without array() wrapper
|
||||||
* @param string $contents
|
* @param string $contents
|
||||||
*/
|
*/
|
||||||
protected function evalArray($contents)
|
protected function evalArray($contents)
|
||||||
{
|
{
|
||||||
return eval('return array(' . $contents . ');');
|
return eval('return array(' . $contents . ');');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an array list into a lookup array.
|
* Converts an array list into a lookup array.
|
||||||
* @param array $array
|
* @param array $array
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function lookup($array)
|
protected function lookup($array)
|
||||||
{
|
{
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach ($array as $val) {
|
foreach ($array as $val) {
|
||||||
$ret[$val] = true;
|
$ret[$val] = true;
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id
|
* Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id
|
||||||
* object based on a string Id.
|
* object based on a string Id.
|
||||||
* @param string $id
|
* @param string $id
|
||||||
* @return HTMLPurifier_ConfigSchema_Interchange_Id
|
* @return HTMLPurifier_ConfigSchema_Interchange_Id
|
||||||
*/
|
*/
|
||||||
protected function id($id)
|
protected function id($id)
|
||||||
{
|
{
|
||||||
return HTMLPurifier_ConfigSchema_Interchange_Id::make($id);
|
return HTMLPurifier_ConfigSchema_Interchange_Id::make($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggers errors for any unused keys passed in the hash; such keys
|
* Triggers errors for any unused keys passed in the hash; such keys
|
||||||
* may indicate typos, missing values, etc.
|
* may indicate typos, missing values, etc.
|
||||||
* @param HTMLPurifier_StringHash $hash Hash to check.
|
* @param HTMLPurifier_StringHash $hash Hash to check.
|
||||||
*/
|
*/
|
||||||
protected function _findUnused($hash)
|
protected function _findUnused($hash)
|
||||||
{
|
{
|
||||||
$accessed = $hash->getAccessed();
|
$accessed = $hash->getAccessed();
|
||||||
foreach ($hash as $k => $v) {
|
foreach ($hash as $k => $v) {
|
||||||
if (!isset($accessed[$k])) {
|
if (!isset($accessed[$k])) {
|
||||||
trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE);
|
trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
@@ -1,248 +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
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type HTMLPurifier_ConfigSchema_Interchange
|
* @type HTMLPurifier_ConfigSchema_Interchange
|
||||||
*/
|
*/
|
||||||
protected $interchange;
|
protected $interchange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type array
|
* @type array
|
||||||
*/
|
*/
|
||||||
protected $aliases;
|
protected $aliases;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Context-stack to provide easy to read error messages.
|
* Context-stack to provide easy to read error messages.
|
||||||
* @type array
|
* @type array
|
||||||
*/
|
*/
|
||||||
protected $context = array();
|
protected $context = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* to test default's type.
|
* to test default's type.
|
||||||
* @type HTMLPurifier_VarParser
|
* @type HTMLPurifier_VarParser
|
||||||
*/
|
*/
|
||||||
protected $parser;
|
protected $parser;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->parser = new HTMLPurifier_VarParser();
|
$this->parser = new HTMLPurifier_VarParser();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates a fully-formed interchange object.
|
* Validates a fully-formed interchange object.
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
* @param HTMLPurifier_ConfigSchema_Interchange $interchange
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function validate($interchange)
|
public function validate($interchange)
|
||||||
{
|
{
|
||||||
$this->interchange = $interchange;
|
$this->interchange = $interchange;
|
||||||
$this->aliases = array();
|
$this->aliases = array();
|
||||||
// PHP is a bit lax with integer <=> string conversions in
|
// PHP is a bit lax with integer <=> string conversions in
|
||||||
// arrays, so we don't use the identical !== comparison
|
// arrays, so we don't use the identical !== comparison
|
||||||
foreach ($interchange->directives as $i => $directive) {
|
foreach ($interchange->directives as $i => $directive) {
|
||||||
$id = $directive->id->toString();
|
$id = $directive->id->toString();
|
||||||
if ($i != $id) {
|
if ($i != $id) {
|
||||||
$this->error(false, "Integrity violation: key '$i' does not match internal id '$id'");
|
$this->error(false, "Integrity violation: key '$i' does not match internal id '$id'");
|
||||||
}
|
}
|
||||||
$this->validateDirective($directive);
|
$this->validateDirective($directive);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates a HTMLPurifier_ConfigSchema_Interchange_Id object.
|
* Validates a HTMLPurifier_ConfigSchema_Interchange_Id object.
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange_Id $id
|
* @param HTMLPurifier_ConfigSchema_Interchange_Id $id
|
||||||
*/
|
*/
|
||||||
public function validateId($id)
|
public function validateId($id)
|
||||||
{
|
{
|
||||||
$id_string = $id->toString();
|
$id_string = $id->toString();
|
||||||
$this->context[] = "id '$id_string'";
|
$this->context[] = "id '$id_string'";
|
||||||
if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) {
|
if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) {
|
||||||
// handled by InterchangeBuilder
|
// handled by InterchangeBuilder
|
||||||
$this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id');
|
$this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id');
|
||||||
}
|
}
|
||||||
// keys are now unconstrained (we might want to narrow down to A-Za-z0-9.)
|
// 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
|
// we probably should check that it has at least one namespace
|
||||||
$this->with($id, 'key')
|
$this->with($id, 'key')
|
||||||
->assertNotEmpty()
|
->assertNotEmpty()
|
||||||
->assertIsString(); // implicit assertIsString handled by InterchangeBuilder
|
->assertIsString(); // implicit assertIsString handled by InterchangeBuilder
|
||||||
array_pop($this->context);
|
array_pop($this->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object.
|
* Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object.
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
||||||
*/
|
*/
|
||||||
public function validateDirective($d)
|
public function validateDirective($d)
|
||||||
{
|
{
|
||||||
$id = $d->id->toString();
|
$id = $d->id->toString();
|
||||||
$this->context[] = "directive '$id'";
|
$this->context[] = "directive '$id'";
|
||||||
$this->validateId($d->id);
|
$this->validateId($d->id);
|
||||||
|
|
||||||
$this->with($d, 'description')
|
$this->with($d, 'description')
|
||||||
->assertNotEmpty();
|
->assertNotEmpty();
|
||||||
|
|
||||||
// BEGIN - handled by InterchangeBuilder
|
// BEGIN - handled by InterchangeBuilder
|
||||||
$this->with($d, 'type')
|
$this->with($d, 'type')
|
||||||
->assertNotEmpty();
|
->assertNotEmpty();
|
||||||
$this->with($d, 'typeAllowsNull')
|
$this->with($d, 'typeAllowsNull')
|
||||||
->assertIsBool();
|
->assertIsBool();
|
||||||
try {
|
try {
|
||||||
// This also tests validity of $d->type
|
// This also tests validity of $d->type
|
||||||
$this->parser->parse($d->default, $d->type, $d->typeAllowsNull);
|
$this->parser->parse($d->default, $d->type, $d->typeAllowsNull);
|
||||||
} catch (HTMLPurifier_VarParserException $e) {
|
} catch (HTMLPurifier_VarParserException $e) {
|
||||||
$this->error('default', 'had error: ' . $e->getMessage());
|
$this->error('default', 'had error: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
// END - handled by InterchangeBuilder
|
// END - handled by InterchangeBuilder
|
||||||
|
|
||||||
if (!is_null($d->allowed) || !empty($d->valueAliases)) {
|
if (!is_null($d->allowed) || !empty($d->valueAliases)) {
|
||||||
// allowed and valueAliases require that we be dealing with
|
// allowed and valueAliases require that we be dealing with
|
||||||
// strings, so check for that early.
|
// strings, so check for that early.
|
||||||
$d_int = HTMLPurifier_VarParser::$types[$d->type];
|
$d_int = HTMLPurifier_VarParser::$types[$d->type];
|
||||||
if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) {
|
if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) {
|
||||||
$this->error('type', 'must be a string type when used with allowed or value aliases');
|
$this->error('type', 'must be a string type when used with allowed or value aliases');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->validateDirectiveAllowed($d);
|
$this->validateDirectiveAllowed($d);
|
||||||
$this->validateDirectiveValueAliases($d);
|
$this->validateDirectiveValueAliases($d);
|
||||||
$this->validateDirectiveAliases($d);
|
$this->validateDirectiveAliases($d);
|
||||||
|
|
||||||
array_pop($this->context);
|
array_pop($this->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extra validation if $allowed member variable of
|
* Extra validation if $allowed member variable of
|
||||||
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
|
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
||||||
*/
|
*/
|
||||||
public function validateDirectiveAllowed($d)
|
public function validateDirectiveAllowed($d)
|
||||||
{
|
{
|
||||||
if (is_null($d->allowed)) {
|
if (is_null($d->allowed)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->with($d, 'allowed')
|
$this->with($d, 'allowed')
|
||||||
->assertNotEmpty()
|
->assertNotEmpty()
|
||||||
->assertIsLookup(); // handled by InterchangeBuilder
|
->assertIsLookup(); // handled by InterchangeBuilder
|
||||||
if (is_string($d->default) && !isset($d->allowed[$d->default])) {
|
if (is_string($d->default) && !isset($d->allowed[$d->default])) {
|
||||||
$this->error('default', 'must be an allowed value');
|
$this->error('default', 'must be an allowed value');
|
||||||
}
|
}
|
||||||
$this->context[] = 'allowed';
|
$this->context[] = 'allowed';
|
||||||
foreach ($d->allowed as $val => $x) {
|
foreach ($d->allowed as $val => $x) {
|
||||||
if (!is_string($val)) {
|
if (!is_string($val)) {
|
||||||
$this->error("value $val", 'must be a string');
|
$this->error("value $val", 'must be a string');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
array_pop($this->context);
|
array_pop($this->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extra validation if $valueAliases member variable of
|
* Extra validation if $valueAliases member variable of
|
||||||
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
|
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
||||||
*/
|
*/
|
||||||
public function validateDirectiveValueAliases($d)
|
public function validateDirectiveValueAliases($d)
|
||||||
{
|
{
|
||||||
if (is_null($d->valueAliases)) {
|
if (is_null($d->valueAliases)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->with($d, 'valueAliases')
|
$this->with($d, 'valueAliases')
|
||||||
->assertIsArray(); // handled by InterchangeBuilder
|
->assertIsArray(); // handled by InterchangeBuilder
|
||||||
$this->context[] = 'valueAliases';
|
$this->context[] = 'valueAliases';
|
||||||
foreach ($d->valueAliases as $alias => $real) {
|
foreach ($d->valueAliases as $alias => $real) {
|
||||||
if (!is_string($alias)) {
|
if (!is_string($alias)) {
|
||||||
$this->error("alias $alias", 'must be a string');
|
$this->error("alias $alias", 'must be a string');
|
||||||
}
|
}
|
||||||
if (!is_string($real)) {
|
if (!is_string($real)) {
|
||||||
$this->error("alias target $real from alias '$alias'", 'must be a string');
|
$this->error("alias target $real from alias '$alias'", 'must be a string');
|
||||||
}
|
}
|
||||||
if ($alias === $real) {
|
if ($alias === $real) {
|
||||||
$this->error("alias '$alias'", "must not be an alias to itself");
|
$this->error("alias '$alias'", "must not be an alias to itself");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!is_null($d->allowed)) {
|
if (!is_null($d->allowed)) {
|
||||||
foreach ($d->valueAliases as $alias => $real) {
|
foreach ($d->valueAliases as $alias => $real) {
|
||||||
if (isset($d->allowed[$alias])) {
|
if (isset($d->allowed[$alias])) {
|
||||||
$this->error("alias '$alias'", 'must not be an allowed value');
|
$this->error("alias '$alias'", 'must not be an allowed value');
|
||||||
} elseif (!isset($d->allowed[$real])) {
|
} elseif (!isset($d->allowed[$real])) {
|
||||||
$this->error("alias '$alias'", 'must be an alias to an allowed value');
|
$this->error("alias '$alias'", 'must be an alias to an allowed value');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
array_pop($this->context);
|
array_pop($this->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extra validation if $aliases member variable of
|
* Extra validation if $aliases member variable of
|
||||||
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
|
* HTMLPurifier_ConfigSchema_Interchange_Directive is defined.
|
||||||
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
* @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
|
||||||
*/
|
*/
|
||||||
public function validateDirectiveAliases($d)
|
public function validateDirectiveAliases($d)
|
||||||
{
|
{
|
||||||
$this->with($d, 'aliases')
|
$this->with($d, 'aliases')
|
||||||
->assertIsArray(); // handled by InterchangeBuilder
|
->assertIsArray(); // handled by InterchangeBuilder
|
||||||
$this->context[] = 'aliases';
|
$this->context[] = 'aliases';
|
||||||
foreach ($d->aliases as $alias) {
|
foreach ($d->aliases as $alias) {
|
||||||
$this->validateId($alias);
|
$this->validateId($alias);
|
||||||
$s = $alias->toString();
|
$s = $alias->toString();
|
||||||
if (isset($this->interchange->directives[$s])) {
|
if (isset($this->interchange->directives[$s])) {
|
||||||
$this->error("alias '$s'", 'collides with another directive');
|
$this->error("alias '$s'", 'collides with another directive');
|
||||||
}
|
}
|
||||||
if (isset($this->aliases[$s])) {
|
if (isset($this->aliases[$s])) {
|
||||||
$other_directive = $this->aliases[$s];
|
$other_directive = $this->aliases[$s];
|
||||||
$this->error("alias '$s'", "collides with alias for directive '$other_directive'");
|
$this->error("alias '$s'", "collides with alias for directive '$other_directive'");
|
||||||
}
|
}
|
||||||
$this->aliases[$s] = $d->id->toString();
|
$this->aliases[$s] = $d->id->toString();
|
||||||
}
|
}
|
||||||
array_pop($this->context);
|
array_pop($this->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected helper functions
|
// protected helper functions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom
|
* Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
* for validating simple member variables of objects.
|
* for validating simple member variables of objects.
|
||||||
* @param $obj
|
* @param $obj
|
||||||
* @param $member
|
* @param $member
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
protected function with($obj, $member)
|
protected function with($obj, $member)
|
||||||
{
|
{
|
||||||
return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member);
|
return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emits an error, providing helpful context.
|
* Emits an error, providing helpful context.
|
||||||
* @throws HTMLPurifier_ConfigSchema_Exception
|
* @throws HTMLPurifier_ConfigSchema_Exception
|
||||||
*/
|
*/
|
||||||
protected function error($target, $msg)
|
protected function error($target, $msg)
|
||||||
{
|
{
|
||||||
if ($target !== false) {
|
if ($target !== false) {
|
||||||
$prefix = ucfirst($target) . ' in ' . $this->getFormattedContext();
|
$prefix = ucfirst($target) . ' in ' . $this->getFormattedContext();
|
||||||
} else {
|
} else {
|
||||||
$prefix = ucfirst($this->getFormattedContext());
|
$prefix = ucfirst($this->getFormattedContext());
|
||||||
}
|
}
|
||||||
throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg));
|
throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a formatted context string.
|
* Returns a formatted context string.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getFormattedContext()
|
protected function getFormattedContext()
|
||||||
{
|
{
|
||||||
return implode(' in ', array_reverse($this->context));
|
return implode(' in ', array_reverse($this->context));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
@@ -1,130 +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
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
protected $context;
|
protected $context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type object
|
* @type object
|
||||||
*/
|
*/
|
||||||
protected $obj;
|
protected $obj;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
protected $member;
|
protected $member;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type mixed
|
* @type mixed
|
||||||
*/
|
*/
|
||||||
protected $contents;
|
protected $contents;
|
||||||
|
|
||||||
public function __construct($context, $obj, $member)
|
public function __construct($context, $obj, $member)
|
||||||
{
|
{
|
||||||
$this->context = $context;
|
$this->context = $context;
|
||||||
$this->obj = $obj;
|
$this->obj = $obj;
|
||||||
$this->member = $member;
|
$this->member = $member;
|
||||||
$this->contents =& $obj->$member;
|
$this->contents =& $obj->$member;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
public function assertIsString()
|
public function assertIsString()
|
||||||
{
|
{
|
||||||
if (!is_string($this->contents)) {
|
if (!is_string($this->contents)) {
|
||||||
$this->error('must be a string');
|
$this->error('must be a string');
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
public function assertIsBool()
|
public function assertIsBool()
|
||||||
{
|
{
|
||||||
if (!is_bool($this->contents)) {
|
if (!is_bool($this->contents)) {
|
||||||
$this->error('must be a boolean');
|
$this->error('must be a boolean');
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
public function assertIsArray()
|
public function assertIsArray()
|
||||||
{
|
{
|
||||||
if (!is_array($this->contents)) {
|
if (!is_array($this->contents)) {
|
||||||
$this->error('must be an array');
|
$this->error('must be an array');
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
public function assertNotNull()
|
public function assertNotNull()
|
||||||
{
|
{
|
||||||
if ($this->contents === null) {
|
if ($this->contents === null) {
|
||||||
$this->error('must not be null');
|
$this->error('must not be null');
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
public function assertAlnum()
|
public function assertAlnum()
|
||||||
{
|
{
|
||||||
$this->assertIsString();
|
$this->assertIsString();
|
||||||
if (!ctype_alnum($this->contents)) {
|
if (!ctype_alnum($this->contents)) {
|
||||||
$this->error('must be alphanumeric');
|
$this->error('must be alphanumeric');
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
public function assertNotEmpty()
|
public function assertNotEmpty()
|
||||||
{
|
{
|
||||||
if (empty($this->contents)) {
|
if (empty($this->contents)) {
|
||||||
$this->error('must not be empty');
|
$this->error('must not be empty');
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
* @return HTMLPurifier_ConfigSchema_ValidatorAtom
|
||||||
*/
|
*/
|
||||||
public function assertIsLookup()
|
public function assertIsLookup()
|
||||||
{
|
{
|
||||||
$this->assertIsArray();
|
$this->assertIsArray();
|
||||||
foreach ($this->contents as $v) {
|
foreach ($this->contents as $v) {
|
||||||
if ($v !== true) {
|
if ($v !== true) {
|
||||||
$this->error('must be a lookup array');
|
$this->error('must be a lookup array');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $msg
|
* @param string $msg
|
||||||
* @throws HTMLPurifier_ConfigSchema_Exception
|
* @throws HTMLPurifier_ConfigSchema_Exception
|
||||||
*/
|
*/
|
||||||
protected function error($msg)
|
protected function error($msg)
|
||||||
{
|
{
|
||||||
throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg);
|
throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: et sw=4 sts=4
|
// vim: et sw=4 sts=4
|
||||||
Binary file not shown.
+8
-8
@@ -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
|
||||||
+12
-12
@@ -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
|
||||||
+19
-19
@@ -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
|
||||||
+11
-11
@@ -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
|
||||||
+9
-9
@@ -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
|
||||||
+8
-8
@@ -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
|
||||||
+10
-10
@@ -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
|
||||||
+8
-8
@@ -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,10 +1,10 @@
|
|||||||
Attr.ID.HTML5
|
Attr.ID.HTML5
|
||||||
TYPE: bool/null
|
TYPE: bool/null
|
||||||
DEFAULT: null
|
DEFAULT: null
|
||||||
VERSION: 4.8.0
|
VERSION: 4.8.0
|
||||||
--DESCRIPTION--
|
--DESCRIPTION--
|
||||||
In HTML5, restrictions on the format of the id attribute have been significantly
|
In HTML5, restrictions on the format of the id attribute have been significantly
|
||||||
relaxed, such that any string is valid so long as it contains no spaces and
|
relaxed, such that any string is valid so long as it contains no spaces and
|
||||||
is at least one character. In lieu of a general HTML5 compatibility flag,
|
is at least one character. In lieu of a general HTML5 compatibility flag,
|
||||||
set this configuration directive to true to use the relaxed rules.
|
set this configuration directive to true to use the relaxed rules.
|
||||||
--# vim: et sw=4 sts=4
|
--# vim: et sw=4 sts=4
|
||||||
+5
-5
@@ -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
|
||||||
+9
-9
@@ -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
|
||||||
+14
-14
@@ -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
|
||||||
+31
-31
@@ -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
|
||||||
+12
-12
@@ -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
|
||||||
+11
-11
@@ -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 <a> tags, and disables
|
This directive turns on the in-text display of URIs in <a> 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
|
||||||
+12
-12
@@ -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
|
||||||
+12
-12
@@ -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
|
||||||
+12
-12
@@ -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
|
||||||
+14
-14
@@ -1,14 +1,14 @@
|
|||||||
AutoFormat.RemoveEmpty.Predicate
|
AutoFormat.RemoveEmpty.Predicate
|
||||||
TYPE: hash
|
TYPE: hash
|
||||||
VERSION: 4.7.0
|
VERSION: 4.7.0
|
||||||
DEFAULT: array('colgroup' => array(), 'th' => array(), 'td' => array(), 'iframe' => array('src'))
|
DEFAULT: array('colgroup' => array(), 'th' => array(), 'td' => array(), 'iframe' => array('src'))
|
||||||
--DESCRIPTION--
|
--DESCRIPTION--
|
||||||
<p>
|
<p>
|
||||||
Given that an element has no contents, it will be removed by default, unless
|
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
|
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
|
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>,
|
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
|
<code>th</code> and <code>td</code>, and also <code>iframe</code> if it
|
||||||
has a <code>src</code>.
|
has a <code>src</code>.
|
||||||
</p>
|
</p>
|
||||||
--# vim: et sw=4 sts=4
|
--# vim: et sw=4 sts=4
|
||||||
+11
-11
@@ -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
|
||||||
+15
-15
@@ -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
|
||||||
+46
-46
@@ -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><a></a></code> but not
|
elements (remove <code><a></a></code> but not
|
||||||
<code><br /></code>), and
|
<code><br /></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
|
||||||
+11
-11
@@ -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
|
||||||
+11
-11
@@ -1,11 +1,11 @@
|
|||||||
CSS.AllowDuplicates
|
CSS.AllowDuplicates
|
||||||
TYPE: bool
|
TYPE: bool
|
||||||
DEFAULT: false
|
DEFAULT: false
|
||||||
VERSION: 4.8.0
|
VERSION: 4.8.0
|
||||||
--DESCRIPTION--
|
--DESCRIPTION--
|
||||||
<p>
|
<p>
|
||||||
By default, HTML Purifier removes duplicate CSS properties,
|
By default, HTML Purifier removes duplicate CSS properties,
|
||||||
like <code>color:red; color:blue</code>. If this is set to
|
like <code>color:red; color:blue</code>. If this is set to
|
||||||
true, duplicate properties are allowed.
|
true, duplicate properties are allowed.
|
||||||
</p>
|
</p>
|
||||||
--# vim: et sw=4 sts=4
|
--# vim: et sw=4 sts=4
|
||||||
+8
-8
@@ -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
|
||||||
+11
-11
@@ -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
|
||||||
+12
-12
@@ -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
|
||||||
+18
-18
@@ -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
|
||||||
+11
-11
@@ -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
|
||||||
+13
-13
@@ -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
|
||||||
+16
-16
@@ -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
|
||||||
+10
-10
@@ -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
|
||||||
+14
-14
@@ -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
|
||||||
+13
-13
@@ -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
|
||||||
+16
-16
@@ -1,16 +1,16 @@
|
|||||||
Cache.SerializerPermissions
|
Cache.SerializerPermissions
|
||||||
TYPE: int/null
|
TYPE: int/null
|
||||||
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>
|
||||||
<p>
|
<p>
|
||||||
In HTML Purifier 4.8.0, this also supports <code>NULL</code>,
|
In HTML Purifier 4.8.0, this also supports <code>NULL</code>,
|
||||||
which means that no chmod'ing or directory creation shall
|
which means that no chmod'ing or directory creation shall
|
||||||
occur.
|
occur.
|
||||||
</p>
|
</p>
|
||||||
--# vim: et sw=4 sts=4
|
--# vim: et sw=4 sts=4
|
||||||
+18
-18
@@ -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
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
Core.AggressivelyRemoveScript
|
||||||
|
TYPE: bool
|
||||||
|
VERSION: 4.9.0
|
||||||
|
DEFAULT: true
|
||||||
|
--DESCRIPTION--
|
||||||
|
<p>
|
||||||
|
This directive enables aggressive pre-filter removal of
|
||||||
|
script tags. This is not necessary for security,
|
||||||
|
but it can help work around a bug in libxml where embedded
|
||||||
|
HTML elements inside script sections cause the parser to
|
||||||
|
choke. To revert to pre-4.9.0 behavior, set this to false.
|
||||||
|
This directive has no effect if %Core.Trusted is true,
|
||||||
|
%Core.RemoveScriptContents is false, or %Core.HiddenElements
|
||||||
|
does not contain script.
|
||||||
|
</p>
|
||||||
|
--# vim: et sw=4 sts=4
|
||||||
+16
-16
@@ -1,16 +1,16 @@
|
|||||||
Core.AllowHostnameUnderscore
|
Core.AllowHostnameUnderscore
|
||||||
TYPE: bool
|
TYPE: bool
|
||||||
VERSION: 4.6.0
|
VERSION: 4.6.0
|
||||||
DEFAULT: false
|
DEFAULT: false
|
||||||
--DESCRIPTION--
|
--DESCRIPTION--
|
||||||
<p>
|
<p>
|
||||||
By RFC 1123, underscores are not permitted in host names.
|
By RFC 1123, underscores are not permitted in host names.
|
||||||
(This is in contrast to the specification for DNS, RFC
|
(This is in contrast to the specification for DNS, RFC
|
||||||
2181, which allows underscores.)
|
2181, which allows underscores.)
|
||||||
However, most browsers do the right thing when faced with
|
However, most browsers do the right thing when faced with
|
||||||
an underscore in the host name, and so some poorly written
|
an underscore in the host name, and so some poorly written
|
||||||
websites are written with the expectation this should work.
|
websites are written with the expectation this should work.
|
||||||
Setting this parameter to true relaxes our allowed character
|
Setting this parameter to true relaxes our allowed character
|
||||||
check so that underscores are permitted.
|
check so that underscores are permitted.
|
||||||
</p>
|
</p>
|
||||||
--# vim: et sw=4 sts=4
|
--# vim: et sw=4 sts=4
|
||||||
+12
-12
@@ -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
|
||||||
+29
-29
@@ -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
|
||||||
+14
-14
@@ -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
|
||||||
+17
-17
@@ -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
|
||||||
+14
-14
@@ -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><object></code> in any descendant of a
|
<code><object></code> in any descendant of a
|
||||||
<code><pre></code> tag. Disabling excludes will allow some
|
<code><pre></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
|
||||||
Loaded 100 of 195 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user