The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::FormValidator::Filters::HTMLScrubber - Data::FormValidator filter that allows to scrub/sanitize html

SYNOPSIS

   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/] ) ]
      }
   };

DESCRIPTION

Data::FormValidator filter that allows to scrub/sanitize html in form field values.

API

This module exports following filters:

html_scrub( %options )

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:

  • default

  • allow

  • deny

  • rules

  • process

  • comment

See HTML::Scrubber for detailed description.

TODO

  • Add more tests using Test::FormValidator suite

  • Add a constraint method/closure in order to test presence of HTML tags in a form field

BUGS

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

Version 0.02

SEE ALSO

Data::FormValidator, HTML::Scrubber

AUTHOR

Enrico Sorcinelli, <bepi@perl.it>

COPYRIGHT AND LICENSE

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.