Warning: Undefined array key "mobile_dir" in /home/kagla/new-sir/old/common.php on line 315
smarteditor2 HTML 소스 자동변환 문제

smarteditor2 HTML 소스 자동변환 문제

smarteditor2 HTML 소스 자동변환 문제

QA

smarteditor2 HTML 소스 자동변환 문제

답변 2

본문

<div style="overflow:auto; width:300px; height:150px;">

 

이런 태그를 입력했는데.... 출력될때는...

 

<div style="width:300px;height:150px;"> 

 

이렇게 변환되어 나오네요.

 

어디서 "overflow:auto;" 이부분을 삭제하는것 같은데요.

 

아시는분 조언 부탁드립니다.

 

감사합니다.

이 질문에 댓글 쓰기 :

답변 2

lib/common.lib.php 파일

함수 function html_purifier($html) {}에 한줄 추가해주심 될거 같네요.

$config->set('CSS.AllowTricky', true); // <== 추가된부분.

 
function html_purifier($html)
{
$f = file(G5_PLUGIN_PATH.'/htmlpurifier/safeiframe.txt');
$domains = array();
foreach($f as $domain){
// 첫행이 # 이면 주석 처리
        if (!preg_match("/^#/", $domain)) {
$domain = trim($domain);
if ($domain)
array_push($domains, $domain);
}
}
// 내 도메인도 추가
    array_push($domains, $_SERVER['HTTP_HOST'].'/');
$safeiframe = implode('|', $domains);
include_once(G5_PLUGIN_PATH.'/htmlpurifier/HTMLPurifier.standalone.php');
$config = HTMLPurifier_Config::createDefault();
// data/cache 디렉토리에 CSS, HTML, URI 디렉토리 등을 만든다.
    $config->set('Cache.SerializerPath', G5_DATA_PATH.'/cache');
$config->set('CSS.AllowTricky', true); // <==추가된 부분
$config->set('HTML.SafeEmbed', false);
$config->set('HTML.SafeObject', false);
$config->set('Output.FlashCompat', false);
$config->set('HTML.SafeIframe', true);
$config->set('URI.SafeIframeRegexp','%^(https?:)?//('.$safeiframe.')%');
$config->set('Attr.AllowedFrameTargets', array('_blank'));
$purifier = new HTMLPurifier($config);
return $purifier->purify($html);
}

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,406
© SIRSOFT
현재 페이지 제일 처음으로