By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,109 Members | 993 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,109 IT Pros & Developers. It's quick & easy.

PHP HTML Scrubber?

P: n/a
I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber
(http://search.cpan.org/~podmaster/HT...8/Scrubber.pm). I need it
to sanitize comments submitted to a web log.

Is there such a thing?
Jun 22 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

deko schreef:
I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber


http://pear.php.net/package/HTML_Safe

Jun 22 '06 #2

P: n/a
>> I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber

http://pear.php.net/package/HTML_Safe


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?

Thanks

Jun 22 '06 #3

P: n/a
>>> I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber

http://pear.php.net/package/HTML_Safe


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?


I downloaded the scripts from http://www.pixel-apes.com/safehtml - 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']);
require_once('/home/username/public_html/cgi-bin/HTML_Safe/safehtml.php');
$content = ??? //how do I invoke safehtml.php against this string variable?
.... more processing ...

Jun 22 '06 #4

P: n/a
On Wed, 21 Jun 2006 22:31:07 -0700, deko wrote:
I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber
(http://search.cpan.org/~podmaster/HT...8/Scrubber.pm). I need it
to sanitize comments submitted to a web log.

Is there such a thing?


http://au2.php.net/strip_tags

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

--
Adam Harvey

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

Jun 23 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.