ユーザー入力データを mysql データベースに挿入すると、mysql_real_escape_string
. 入力データには bbcode が含まれています[img][/img]
。
以下は、htmlが出力されるときの行です。
$information = $this->bbcode(stripslashes($this->swearfilter($row['information'])),1);
echo $information;
この例に関して、これは XSS 攻撃を防ぐ正しい方法ですか、それとも使用しますhtmlspecialchars($var,ENT_QUOTES)
かhtmlentities
?