I need a filter function for a project I’m working on.
I am thinking about using HTML purifier. However I concerned about it performance.
Does any of you guys used or using HTML purifier. Or do you suggest another library or class with similar functionality.
The most important issues are:
- utf-8 support
- xss security
If you want to :
Then I would say that HTMLPurifier is the right tool for the job.
I’ve used it a couple of times — and I have never heard of another tool that would do that kind of stuff well.
As a sidenote about performances : you are validating/filtering the HTML when it is typed by the user, of course ?
I meant :
And you don’t use HTMLPurifier each time some HTML data is output, do you ? That would be awful for performances ^^
Oh, also : did you try activating some cache for HTMLPurifier ?
See the Cache section, in the documentation.