그누보드
그누보드 검색에서 HTML 코드 출력되는 문제 해결법
유앤아이의 뉴패러다임
2012. 10. 21. 10:54
기본 그누보드에서 최신글 불러오기나 홈페이지의 내용을 검색하다 보면
html 소스코드와 글의 내용이 출력이 됩니다.
이럴경우 다음과 같이 해결할수가 있습니다.
/bbs/search.php 파일을 편집합니다.
192번 라인에 보면
{
$content = cut_str(get_text($row[wr_content]),300,"…");
if (strstr($sfl, "wr_content"))
$content = search_font($stx, $content);
}
$content = cut_str(get_text($row[wr_content]),300,"…");
if (strstr($sfl, "wr_content"))
$content = search_font($stx, $content);
}
수정 전
$content = cut_str(get_text($row[wr_content]),300,"…");
수정후
$content = cut_str(strip_tags($row[wr_content]),300,"…");
으로 바꾸어 줍니다.
그럼 홈페이지에서 검색시에 html 소스 + 글 내용이 출력되는것이 글만 출력됩니다.
(아래 예제 참조)