Strict HTML Validation and Filtering in PHP

前端 未结 4 806
刺人心
刺人心 2020-12-08 03:04

I\'m looking for best practices for performing strict (whitelist) validation/filtering of user-submitted HTML.

Main purpose is to filter out XSS and similar nasties

4条回答
  •  死守一世寂寞
    2020-12-08 03:52

    I used HTML Purifier with success and haven't had any xss or other unwanted input filter through. I also run the sanitize HTML through the Tidy extension to make sure it validates as well.

提交回复
热议问题