The problem with htmlspecialchars and Zend_Filter_HtmlEntities is that if you try to cross out all the html tags (for example, "a" and "img", etc.), then instead of deleting them, you get this markup on your output.
Take blog comments for example. If you use htmlspecialchars or Zend_Filter_HtmlEntities in a comment where someone is trying to use html to enter a link, you get this markup that appears when the comment is displayed. But if you use strip_tags or Zend_Filter_StripTags, you end up processing the comment, since none of them are smart enough to realize that "<3" is not a tag and just removes everything from "<3" to the end of the comment (or until it finds ">").
It would be nice if Zend had something like HTMLPurifier, where it actually validates and validates the input data before removing the tags. This means that things like "<3" are left alone where things like "Amazing Site" become "Amazing Site".
This is the problem I'm trying to work with, and at the moment it seems to me that I'm going to write my own Zend_Filter class, which is basically a wrapper for HTMLPurifier.
Sean hagen
source share