Data::FormValidator::Filters::HTMLScrubber - Data::FormValidator filter that allows to scrub/sanitize html
use Data::FormValidator::Filters::HTMLScrubber qw(html_scrub); # Data::FormValidator Profile: my $dfv_profile = { required => [ qw/foo bar/ ], field_filters => { foo => [ 'trim', html_scrub( allow => [qw/b i em strong/] ) ] } };
Data::FormValidator filter that allows to scrub/sanitize html in form field values.
This module exports following filters:
This will create a filter that will scrub/sanitize tha vaule of the field of the form that is being submitted.
The %options arguments are correspondant to HTML::Scrubber constructor arguments:
%options
default
allow
deny
rules
process
comment
See HTML::Scrubber for detailed description.
Add more tests using Test::FormValidator suite
Add a constraint method/closure in order to test presence of HTML tags in a form field
Please submit bugs to CPAN RT system at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-FormValidator-Filters-HTMLScrubber or by email at bug-data-formValidator-filters-htmlscrubber@rt.cpan.org
Patches are welcome and I'll update the module if any problems will be found.
Version 0.02
Data::FormValidator, HTML::Scrubber
Enrico Sorcinelli, <bepi@perl.it>
Copyright (C) 2006 by Enrico Sorcinelli
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
To install Data::FormValidator::Filters::HTMLScrubber, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::FormValidator::Filters::HTMLScrubber
CPAN shell
perl -MCPAN -e shell install Data::FormValidator::Filters::HTMLScrubber
For more information on module installation, please visit the detailed CPAN module installation guide.