What is the correct way to detect whether string inputs contain HTML or not?

前端 未结 13 725
旧时难觅i
旧时难觅i 2020-12-23 15:08

When receiving user input on forms I want to detect whether fields like \"username\" or \"address\" does not contain markup that has a special meaning in XML (RSS feeds) or

13条回答
  •  萌比男神i
    2020-12-23 15:32

    HTML Purifier does a good job and is very easy to implement. You could also use a Zend Framework filter like Zend_Filter_StripTags.

    HTML Purifier doesn't just fix HTML.

提交回复
热议问题