Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コントローラーからビューに渡されるデータがたくさんあります。AppController beforeRenderのように、コントローラーから渡されるすべてのデータを取得し、そのデータに対してサニタイズ-> htmlを実行する簡単な方法はありますか?
簡単な方法:App::import('Sanitize');モデル内で、beforeSave内のすべてをサニタイズします
App::import('Sanitize');
ただし、ケーキクックブックは別の方法をアドバイスしています。
XSSに対するサニタイズの場合、一般に、生のHTMLを変更せずにデータベースに保存し、出力/表示時にサニタイズする方が適切です。