PHP HTML Scrubber?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber  
(  I need it  
to sanitize comments submitted to a web log.

Is there such a thing?

Re: PHP HTML Scrubber?

deko schreef:

Quoted text here. Click to load it

Re: PHP HTML Scrubber?

Quoted text here. Click to load it

This looks interesting, but...

How do I verify if my host's server has HTMLSax3 installed?

Is HTMLSax3 a script I can install in my user directory if my host does not have  
it installed?

How do I pass the string I want checked to the Safe.php script?


Re: PHP HTML Scrubber?

Quoted text here. Click to load it

I downloaded the scripts from - which  
includes HTMLSax3 as well as Decorators.php and States.php.

I was able to get the demo working, but I need to do something like this (in a  
script, not in the page):
$content = trim($_POST['comment']);
$content = ??? //how do I invoke safehtml.php against this string variable?
... more processing ...

Re: PHP HTML Scrubber?

On Wed, 21 Jun 2006 22:31:07 -0700, deko wrote:
Quoted text here. Click to load it

It's probably not as functional as HTML::Scrubber, but if you're basically
just wanting to strip HTML out, it'll get the job done.


Adam Harvey

To e-mail: don't make an example out of me!

Site Timeline