HTML::StripScripts::Regex - XSS filter using a regular expression


HTML-StripScripts-Regex documentation  | view source Contained in the HTML-StripScripts-Regex distribution.

Index


NAME

Top

HTML::StripScripts::Regex - XSS filter using a regular expression

VERSION

Top

Version 0.02

SYNOPSIS

Top

This class subclasses HTML::StripScripts, and adds an input method based on a regular expression. See HTML::StripScripts.

  use HTML::StripScripts::Regex;

  my $hss = HTML::StripScripts::Regex->new({ Context => 'Inline' });

  $hss->input("<i>hello, world!</i>");

  print $hss->filtered_document;

Using a regular expression to parse HTML is error prone and inefficient for large documents. If HTML::Parser is available then HTML::StripScripts::Parser should be used in preference to this module.

METHODS

Top

This subclass adds the following methods to those of HTML::StripScripts.

input ( TEXT )

Parses an HTML document and runs it through the filter. TEXT must be the entire HTML document to be filtered, as a single flat string.

SUBCLASSING

Top

The HTML::StripScripts::Regex class is subclassable, in exactly the same way as HMTL::StripScripts. See "SUBCLASSING" in HTML::StripScripts for details.

SEE ALSO

Top

HTML::StripScripts, HTML::StripScripts::Parser, HTML::Parser

AUTHOR

Top

Nick Cleaton, <nick at cleaton dot net>

COPYRIGHT & LICENSE

Top


HTML-StripScripts-Regex documentation  | view source Contained in the HTML-StripScripts-Regex distribution.