2

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!

Mark Blades
  • 349
  • 1
  • 4
  • 11
  • *(alternatives)* http://htmlpurifier.org/ and http://de3.php.net/manual/en/function.strip-tags.php and http://de3.php.net/manual/en/book.filter.php – Gordon Apr 27 '10 at 12:43

2 Answers2

12

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

osm
  • 4,186
  • 3
  • 23
  • 24
  • Ah, this is useful. One for the future. Many thanks! Does anyone have any comments on the original class I posted? – Mark Blades Apr 27 '10 at 13:29
  • i can also recommend cakephp's sanitize class http://book.cakephp.org/view/321/Data-Sanitation-The-Sanitize-Class it can easily be forked. – osm Apr 27 '10 at 13:41
-5

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
  • 47,736
  • 6
  • 59
  • 94
  • 4
    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 Apr 27 '10 at 13:07
  • 1
    Yes, I echo Shadi. A bit of a patronising response. But I'm in a forgiving mood :) Thanks for the response nonetheless. – Mark Blades Apr 27 '10 at 13:25
  • 1
    @symcbean The place for patronizing is in a comment on the question, not in an "answer". – dolmen Mar 16 '12 at 09:07