Allow user submitted HTML in PHP

前端 未结 7 1339
后悔当初
后悔当初 2020-12-01 20:13

I want to allow a lot of user submitted html for user profiles, I currently try to filter out what I don\'t want but I am now wanting to change and use a whitelist approach.

7条回答
  •  感情败类
    2020-12-01 20:51

    HTML Purifier is a standards-compliant HTML filter library written in PHP. HTML Purifier will not only remove all malicious code (better known as XSS) with a thoroughly audited, secure yet permissive whitelist, it will also make sure your documents are standards compliant, something only achievable with a comprehensive knowledge of W3C's specifications.

提交回复
热议问题