| 1 |
NAME |
| 2 |
HTML::StripScripts::Parser - XSS filter using HTML::Parser |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use HTML::StripScripts::Parser; |
| 6 |
|
| 7 |
my $hss = HTML::StripScripts::Parser->new( |
| 8 |
{ |
| 9 |
Context => 'Document', |
| 10 |
Rules => { ... }, |
| 11 |
}, |
| 12 |
strict_comment => 1, |
| 13 |
strict_names => 1, |
| 14 |
); |
| 15 |
|
| 16 |
$hss->parse_file("foo.html"); |
| 17 |
|
| 18 |
print $hss->filtered_document; |
| 19 |
|
| 20 |
DESCRIPTION |
| 21 |
|
| 22 |
|
| 23 |
This class subclasses both HTML::StripScripts and HTML::Parser, adding |
| 24 |
the input methods that HTML::Parser provides to HTML::StripScripts. |
| 25 |
|
| 26 |
See HTML::StripScripts and HTML::Parser. |
| 27 |
|
| 28 |
CONSTRUCTORS |
| 29 |
new ( CONFIG, [PARSER_OPTIONS] ) |
| 30 |
Creates a new "HTML::StripScripts::Parser" object, and invokes the |
| 31 |
HTML::Parser init() method so that tags are fed to the correct |
| 32 |
HTML::StripScripts methods. |
| 33 |
|
| 34 |
The CONFIG parameter has the same semantics as the CONFIG parameter |
| 35 |
to the HTML::StripScripts constructor. |
| 36 |
|
| 37 |
Any PARSER_OPTIONS supplied will be passed on to the HTML::Parser |
| 38 |
init method, allowing you to influence the way the input is parsed. |
| 39 |
|
| 40 |
You cannot use PARSER_OPTIONS to set HTML::Parser event handlers, |
| 41 |
since "HTML::StripScripts::Parser" uses all of the event hooks |
| 42 |
itself. |
| 43 |
|
| 44 |
METHODS |
| 45 |
See HTML::Parser for input methods, HTML::StripScripts for output |
| 46 |
methods. |
| 47 |
|
| 48 |
SUBCLASSING |
| 49 |
The "HTML::StripScripts::Parser" class is subclassable. Filter objects |
| 50 |
are plain hashes. The hss_init() method takes the same arguments as |
| 51 |
new(), and calls the initialization methods of both "HTML::StripScripts" |
| 52 |
and "HTML::Parser". |
| 53 |
|
| 54 |
See "SUBCLASSING" in HTML::StripScripts and "SUBCLASSING" in |
| 55 |
HTML::Parser. |
| 56 |
|
| 57 |
SEE ALSO |
| 58 |
HTML::StripScripts, HTML::Parser |
| 59 |
|
| 60 |
AUTHOR |
| 61 |
Original author Nick Cleaton E<lt>[email protected]<gt> |
| 62 |
New code added and module maintained by Clinton Gormley |
| 63 |
E<lt>[email protected]<gt> |
| 64 |
|
| 65 |
|
| 66 |
COPYRIGHT |
| 67 |
Copyright (C) 2003 Nick Cleaton. All Rights Reserved. |
| 68 |
|
| 69 |
This module is free software; you can redistribute it and/or modify it |
| 70 |
under the same terms as Perl itself. |
| 71 |
|