All,
I am building a small site using PHP. In the site, I receive user-generated text content. I want to allow some safe HTML tag (e.g., formatting) as well as MathML. How do I go about compiling a white list for a strip_tags() function? Is there a well accepted white list I can use?
The standard
strip_tagsfunction is not enough for security, since it doesn’t validate attributes at all. Use a more complete library explicitly for the purpose of completely sanitizing HTML like HTML Purifier.