HTML::StripScripts::Regex - XSS filter using a regular expression
Version 0.02
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.
This subclass adds the following methods to those of HTML::StripScripts.
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.
The HTML::StripScripts::Regex class is subclassable, in exactly the same way as HMTL::StripScripts. See "SUBCLASSING" in HTML::StripScripts for details.
HTML::StripScripts::Regex
HMTL::StripScripts
HTML::StripScripts, HTML::StripScripts::Parser, HTML::Parser
Nick Cleaton, <nick at cleaton dot net>
<nick at cleaton dot net>
Copyright 2009 Nick Cleaton, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTML::StripScripts::Regex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::StripScripts::Regex
CPAN shell
perl -MCPAN -e shell install HTML::StripScripts::Regex
For more information on module installation, please visit the detailed CPAN module installation guide.