views:

234

answers:

2

Hi,

I'm wondering if anybody has used this class and found it to be reliable?

http://www.phpclasses.org/package/3746-PHP-Remove-unsafe-tags-and-attributes-from-HTML-code.html

Many thanks!

+4  A: 

i recommend http://htmlpurifier.org/ HTML Purifier for cleaning strings safely.

Osman Üngür
Ah, this is useful. One for the future. Many thanks! Does anyone have any comments on the original class I posted?
Mark Blades
i can also recommend cakephp's sanitize class http://book.cakephp.org/view/321/Data-Sanitation-The-Sanitize-Class it can easily be forked.
Osman Üngür
+2  A: 

I'm wondering if anybody has used this class and found it to be reliable?

erm....

1) phpclasses invites feedback from users - if there's no feedback there, why do you think you'd find it here?

2) its a fairly generic bit of code - the value is in how you apply it, you don't state what your objectives are nor what you've compared it with,

3) certainly the code looks to be competently written and allows a much finer level of control than striptags() but as in 2 we can't say what value that is to you without any information about what you are trying to achieve.

C.

symcbean
As much as i kinda agree with the points you have made, i can't help by think they are predominantly unnecessary as one can almost make an "educated guess" on what the user is attempting to achieve, and being helpful rather than wasting time on patronising could be more beneficial...?
Shadi Almosri
Yes, I echo Shadi. A bit of a patronising response. But I'm in a forgiving mood :) Thanks for the response nonetheless.
Mark Blades