font 태그가 안먹힙니다. 정보
font 태그가 안먹힙니다.본문
4.31.02 로 업데이트 한 후에
dhml 을 통한 입력내용 $view[content]가 출력될 때
<font> 로 적용되는 태그가 하나도 안먹힙니다.
배경 박스에 흰글을 <font color='#ffffff'>흰글</font> 과 같이 넣으면
td 에 적용된 스타일(검은색글)이 그대로 먹히구요.. 글자 크기도 역시입니다.
(볼드 : strong 태그도 안먹네요...)
에디터로 보면 정상이고 $view[content]로 출력될 때만 문제가 됩니다.
4.31.00 버젼이 CSRF 같은거 방지하는게 강조된거 같은데
common.lib.php 내용중
// 악성태그 변환
function bad_tag_convert($code)
{
return preg_replace("/\<([\/]?)(script|iframe)([^\>]*)\>/i", "<$1$2$3>", $code);
}
이나
// 내용을 변환
function conv_content($content, $html)
{
global $config, $board;
if ($html)
{
$source = array();
$target = array();
$source[] = "//";
$target[] = "";
if ($html == 2) { // 자동 줄바꿈
$source[] = "/\n/";
$target[] = "<br/>";
}
$table_begin_count = substr_count(strtolower($content), "<table");
$table_end_count = substr_count(strtolower($content), "</table");
for ($i=$table_end_count; $i<$table_begin_count; $i++)
{
$content .= "</table>";
}
$content = preg_replace($source, $target, $content);
$content = bad_tag_convert($content);
$content = preg_replace("/(on)([^\=]+)/i", "on$2", $content);
$content = preg_replace("/(dy)(nsrc)/i", "dy$2", $content);
$content = preg_replace("/(sc)(ript)/i", "sc$2", $content);
$content = preg_replace("/(ex)(pression)/i", "ex$2", $content);
....
부분에서 font 태그가 처리되는 것일까요?
어디를 손봐야 하는지 좀 알려주시길 부탁드립니다.
dhml 을 통한 입력내용 $view[content]가 출력될 때
<font> 로 적용되는 태그가 하나도 안먹힙니다.
배경 박스에 흰글을 <font color='#ffffff'>흰글</font> 과 같이 넣으면
td 에 적용된 스타일(검은색글)이 그대로 먹히구요.. 글자 크기도 역시입니다.
(볼드 : strong 태그도 안먹네요...)
에디터로 보면 정상이고 $view[content]로 출력될 때만 문제가 됩니다.
4.31.00 버젼이 CSRF 같은거 방지하는게 강조된거 같은데
common.lib.php 내용중
// 악성태그 변환
function bad_tag_convert($code)
{
return preg_replace("/\<([\/]?)(script|iframe)([^\>]*)\>/i", "<$1$2$3>", $code);
}
이나
// 내용을 변환
function conv_content($content, $html)
{
global $config, $board;
if ($html)
{
$source = array();
$target = array();
$source[] = "//";
$target[] = "";
if ($html == 2) { // 자동 줄바꿈
$source[] = "/\n/";
$target[] = "<br/>";
}
$table_begin_count = substr_count(strtolower($content), "<table");
$table_end_count = substr_count(strtolower($content), "</table");
for ($i=$table_end_count; $i<$table_begin_count; $i++)
{
$content .= "</table>";
}
$content = preg_replace($source, $target, $content);
$content = bad_tag_convert($content);
$content = preg_replace("/(on)([^\=]+)/i", "on$2", $content);
$content = preg_replace("/(dy)(nsrc)/i", "dy$2", $content);
$content = preg_replace("/(sc)(ript)/i", "sc$2", $content);
$content = preg_replace("/(ex)(pression)/i", "ex$2", $content);
....
부분에서 font 태그가 처리되는 것일까요?
어디를 손봐야 하는지 좀 알려주시길 부탁드립니다.
댓글 전체

<font> 에서
on 이 먹히는군요.
일단 주석 처리 하시고 결과 보심이 어떨까요 ?
$content = preg_replace("/(on)([^\=]+)/i", "on$2", $content);
on 이 먹히는군요.
일단 주석 처리 하시고 결과 보심이 어떨까요 ?
$content = preg_replace("/(on)([^\=]+)/i", "on$2", $content);
감사합니다. 어쩐지 strong 도 안먹히더니.. 이거가 태그 필터링하는거였군요.
그렇다면... 4.31.02 업한분들은 다 안된다는 얘기인데...
버젼업된 cheditor를 안써서 잘 모르겠지만 거기서는 font 태그를 안쓰나보네요...
그렇다면... 4.31.02 업한분들은 다 안된다는 얘기인데...
버젼업된 cheditor를 안써서 잘 모르겠지만 거기서는 font 태그를 안쓰나보네요...