|
답변 4개 / 댓글 2개
lib/common.lib.php 파일에서
내용을 변환 부분을 이걸로 교체하셔요
해킹때문에 관리자만 아이프레임 사용할수 있도록함
// 내용을 변환
function conv_content($content, $html)
{
global $config, $board, $member, $view;
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);
$adm=is_admin($view[mb_id]);
if ($adm != 'super' && $adm != 'group') $content = bad_tag_convert($content);
// XSS (Cross Site script) 막기
// 완벽한 XSS 방지는 없다.
// 081022 : CSRF 방지
//$content = preg_replace("/(on)(abort|blur|change|click|dblclick|dragdrop|error|focus|keydown|keypress|keyup|load|mousedown|mousemove|mouseout|mouseover|mouseup|mouseenter|mouseleave|move|reset|resize|select|submit|unload)/i", "$1<!-- XSS Filter -->$2", $content);
//$content = preg_replace("/(on)([^\=]+)/i", "on$2", $content);
if ($adm != 'super' && $adm != 'group') $content = preg_replace("/(on)([a-z]+)([^a-z]*)(\=)/i", "on$2$3$4", $content);
$content = preg_replace("/(dy)(nsrc)/i", "dy$2", $content);
$content = preg_replace("/(lo)(wsrc)/i", "lo$2", $content);
if ($adm != 'super' && $adm != 'group') $content = preg_replace("/(sc)(ript)/i", "sc$2", $content);
$content = preg_replace("/(ex)(pression)/i", "ex$2", $content);
}
else // text 이면
{
// & 처리 : & 등의 코드를 정상 출력함
$content = html_symbol($content);
// 공백 처리
//$content = preg_replace("/ /", " ", $content);
$content = str_replace(" ", " ", $content);
$content = str_replace("\n ", "\n ", $content);
$content = get_text($content, 1);
$content = url_auto_link($content);
}
return $content;
}
답변을 작성하려면 로그인이 필요합니다.