게시물에서 자기소개...html태그막는법 정보
게시물에서 자기소개...html태그막는법본문
<!-- 자기소개 출력 -->
<?
// 자기소개 데이터
$profile=get_member($view[mb_id], "mb_profile");
// 프로필이 있을 때
if($profile['mb_profile']){
echo $profile['mb_profile'];
} else {
echo "소개 내용이 없습니다.";
}
?>
사람들이 플래시박고 스크립트 다먹히네욥..ㅎㄷㄷ;
막는법좀알려주세욥..ㅎㄷ;
사이트가 위험해짐..ㅠ;
<?
// 자기소개 데이터
$profile=get_member($view[mb_id], "mb_profile");
// 프로필이 있을 때
if($profile['mb_profile']){
echo $profile['mb_profile'];
} else {
echo "소개 내용이 없습니다.";
}
?>
사람들이 플래시박고 스크립트 다먹히네욥..ㅎㄷㄷ;
막는법좀알려주세욥..ㅎㄷ;
사이트가 위험해짐..ㅠ;
댓글 전체
function strips_tag_func() {
$search = array ("'<script[^>]*?>.*?</script>'si", // 자바 스크립트 제거
"'<[\/\!]*?[^<>]*?>'si", // HTML 태그 제거
"'([\r\n])[\s]+'", // 공백 제거
"'&(quot|#34);'i", // HTML 엔티티 치환
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'\"|\'|\’|\“|\”'i",
"'\n|\r| 'i",
"'(\d+);'e",); // php로 실행
$replace = array ("",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
" ",
" ",
"chr(\\1)");
$text = trim(preg_replace($search, $replace, $text));
return $text;
}
?>
$search = array ("'<script[^>]*?>.*?</script>'si", // 자바 스크립트 제거
"'<[\/\!]*?[^<>]*?>'si", // HTML 태그 제거
"'([\r\n])[\s]+'", // 공백 제거
"'&(quot|#34);'i", // HTML 엔티티 치환
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'\"|\'|\’|\“|\”'i",
"'\n|\r| 'i",
"'(\d+);'e",); // php로 실행
$replace = array ("",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
" ",
" ",
"chr(\\1)");
$text = trim(preg_replace($search, $replace, $text));
return $text;
}
?>
아.. 어떻게 적용하나요?ㅎㄷ;