Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Framework Filter Input StripTags and "<3"

I'm currently using Zend_Filter_StripTags in a commenting system, but stuff kinda breaks when '<3' is entered. StripTags doesn't seem to be smart enough to realize that it's not an HTML tag, and creating the filter as "new Zend_Filter_StripTags(array('3'))" doesn't seem to work either.

Should I pass the input through a regexp first, or is there a way to get Zend_Filter_StripTags to straighten up and fly right?

like image 401
Sean Hagen Avatar asked Mar 01 '23 00:03

Sean Hagen


1 Answers

Ended up writing a Zend_Filter class that was basically a wrapper for HTMLPurifier. Works perfectly, because HTMLPurifier is a LOT smarter than striptags.

like image 128
Sean Hagen Avatar answered Mar 11 '23 04:03

Sean Hagen