PHP HTML Scrubber?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • deko

    #1

    PHP HTML Scrubber?

    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?


  • Sjoerd

    #2
    Re: PHP HTML Scrubber?


    deko schreef:
    [color=blue]
    > I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber[/color]



    Comment

    • deko

      #3
      Re: PHP HTML Scrubber?

      >> I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber[color=blue]
      >
      > http://pear.php.net/package/HTML_Safe[/color]

      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

      Comment

      • deko

        #4
        Re: PHP HTML Scrubber?

        >>> I'm looking for a php HTML scrubber similar to the PERL HTML::Scrubber[color=blue][color=green]
        >>
        >> http://pear.php.net/package/HTML_Safe[/color]
        >
        > 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?[/color]

        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 ...

        Comment

        • Adam Harvey

          #5
          Re: PHP HTML Scrubber?

          On Wed, 21 Jun 2006 22:31:07 -0700, deko wrote:[color=blue]
          > 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?[/color]



          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!

          Comment

          Working...