사이트 내 전체검색
그누보드
검색목록
[팁] 최근글,목록등에서 태그를 포함한 특수문자를 없애기
로빈아빠
https://cmd.kr/gnu/221 URL이 복사되었습니다.

본문

DB 설정이 이상한지 글자가 계쏙 깨어진다.
//<P>&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;&#038;nbsp;아이폰은...

이런식으로 찍혀 나올때.. 변환도 잘안된다..
정답은 urldecode()를 사용하는것인데 잘안된다..

몇가지 편법을 사용해서 다음과 같이 조치하였다.


<? for ($i=0; $i<min($rows,count($list)); $i++) { 

 $arr=array("&#038;"=>"&","&nbsp;"=>" ","  "=>" ");
 if ($options[mode]==2) $wr_subject=htmlspecialchars_decode($list[$i][wr_content]); //댓글
 else $wr_subject=htmlspecialchars_decode($list[$i][wr_subject]);
 $wr_subject=strtr($wr_subject,$arr);
 $wr_subject=urldecode(wr_subject);
 for ($i2=0;$i2<20;$i2++) $wr_subject=str_replace("  "," ",$wr_subject);
 $list[$i][wr_subject]=$wr_subject;
 $list[$i][wr_subject] = strip_tags2($list[$i][wr_subject]);
?>
 <div class=best_simple_line>
 <?
 if ($options[numbers]=="img") {
  $img="$g4[path]/glite/img/".($i+1).".gif";
  if (!file_exists($img)) $img="$g4[path]/glite/img/20.gif";
  echo "<img src='$img' border=0 align=absmiddle>";
 }
 if ($options[numbers]=="li") echo "<li class=best_simple_line_li>";
 ?>
  <a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$list[$i][bo_table]?>&wr_id=<?=$list[$i][wr_id]?>'
  title='<?=$list[$i][wr_name]?> <?=substr($list[$i][wr_datetime],2,14)?> <?=get_text($arr_board["{$list[$i][bo_table]}"])?>'
  ><?=cut_str($list[$i][wr_subject],$subject_len-($list[$i][wr_comment]?3:0),'')?></a>

 <? if ($options[numbers]=="li") echo "</li>"; ?>

 </div>
<? } ?>

 

댓글목록

등록된 댓글이 없습니다.

그누보드
65 (2/2P)

Search

Copyright © Cmd 명령어 3.144.101.75