i

게시판의 rss를 눌렀을때 태그가 다 보여요~ㅜㅡ

게시판에서 rss 클릭시...br태그소스가 다 뿌려지는데...
그누보드 디렉토리의 bbs/rss.php파일인데요..


예제: 아래처럼 그냥 다뿌려지는데 해결방법이 없는지요?
<P><STRONG>나무</STRONG><BR><U>
|

댓글 4개

태그가 그냥 뿌려지는 경우는

htmlspecialchars($contents)



htmlentitiy($contents)

했을 경우에 그대로 노출 됩니다.


혹시 이부분 적용되었나 보시고 제거 하시면 됩니다.
위부분은 전혀 없어요...
아래가 소스인데요...

Header("Content-type: text/xml");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

$sql = " select gr_subject from $g4[group_table] where gr_id = '$row[gr_id]' ";
$row = sql_fetch($sql);
$subj1 = specialchars_replace($row[gr_subject], 255);

echo "<?xml version=\"1.0\" encoding=\"$g4[charset]\"?>\n";
echo "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
echo "<channel>\n";
echo "<title>".specialchars_replace("$config[cf_title] > $subj1 > $subj2")."</title>\n";
echo "<link>".specialchars_replace("$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table")."</link>\n";
echo "<description>테스트 버전 0.2 (2004-04-26)</description>\n";
echo "<language>ko</language>\n";

$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
order by wr_num, wr_reply limit 0, $lines ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$file = "";

if (strstr($row[wr_option], 'html'))
$html = 1;
else
$html = 0;

echo "<item>\n";
echo "<title>".specialchars_replace($row[wr_subject])."</title>\n";
echo "<link>".specialchars_replace("$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]")."</link>\n";
echo "<description><![CDATA[".$file . conv_content($row[wr_content], $html)."]]></description>\n";
echo "<dc:creator>".specialchars_replace($row[wr_name])."</dc:creator>\n";
$date = $row[wr_datetime];
// rss 리더 스킨으로 호출하면 날짜가 제대로 표시되지 않음
//$date = substr($date,0,10) . "T" . substr($date,11,8) . "+09:00";
$date = date('r', strtotime($date));
echo "<dc:date>$date</dc:date>\n";
echo "</item>\n";
}
specialchars_replace

이 함수는 아마도 그누보드에서 만든듯 하구요,

이게

htmlspecialchars()를 약간 수정한것 같습니다.


if (strstr($row[wr_option], 'html'))
$html = 1;
else
$html = 0;


여기서 html 사용여부 결정하는듯한데, 0이면 html을 그냥 뿌려 버리는듯하군요.

if (strstr($row[wr_option], 'html'))
$html = 1;
else
$html = 0;

if($bo_table=='table_name')
$htlm=1;

로 변경하시면 될듯요.
아래부분에서 말씀하신것처럼 하지 않고 그냥 숫자를 두개 바꾸어주었더니 정상작동하네요^^
감사합니다.

if (strstr($row[wr_option], 'html'))
$html = 0; //이게 원래 1
else
$html = 1; //이게 원래 0
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
15년 전 조회 2,480
15년 전 조회 1,736
15년 전 조회 1,521
15년 전 조회 1,988
15년 전 조회 1,971
15년 전 조회 1,660
15년 전 조회 2,243
15년 전 조회 1,515
15년 전 조회 1,572
15년 전 조회 2,129
15년 전 조회 1,793
15년 전 조회 1,623
15년 전 조회 5,053
15년 전 조회 1,753
15년 전 조회 1,798
15년 전 조회 1,658
15년 전 조회 1,695
15년 전 조회 1,604
15년 전 조회 1,762
15년 전 조회 2,652
🐛 버그신고