Re: [RFC] Data::FormValidator::Filters::HTMLScrubber - new module proposal

2006-03-25 Thread Enrico Sorcinelli
On Fri, 24 Mar 2006 11:14:00 -0500
Mark Stosberg [EMAIL PROTECTED] wrote:

 I like the API and as the Data::FormValidator maintainer, I welcome this
 addition to the Data::FormValidator name space. I suspect I'll use this
 contribution myself!
 
   Mark

Hi Mark,

I just uploaded Data::FormValidator::Filters::HTMLScrubber 0.02 to CPAN :-)

Feel free to add Data::FormValidator::Filters::HTMLScrubber into 'SEE ALSO'
Data::FormValidator::Filters documentation section. 
Note also that items in that section have a space as first character but I think
that they shouldn't be verbatim paragraphs since they use L formatting code.

Regards

- Enrico


[RFC] Data::FormValidator::Filters::HTMLScrubber - new module proposal

2006-03-24 Thread Enrico Sorcinelli

Hi all,

I just realized Data::FormValidator::Filters::HTMLScrubber, a simple DFV
filter that allows to scrub/sanitize html in form field values.

It's available for evaluating and testing at:

http://modperl.it/Data-FormValidator-Filters-HTMLScrubber-0.02.tar.gz 
http://modperl.it/Apache-Session-Memcached-0.01.tar.gz

I've attached a temporary POD at the end of the message.

I searched on CPAN and I've not found any similar module (the reason why I wrote
it). Also I searched over Data::FormVAlidator mailing list archives with same 
result.


Since I would put it on CPAN, any suggestions about the module and/or namespace
are welcome.

Thanks in advance

by

   - Enrico


---


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.

SEE ALSO
   Data::FormValidator, HTML::Scrubber

AUTHOR
   Enrico Sorcinelli, [EMAIL PROTECTED]

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.




Re: [RFC] Data::FormValidator::Filters::HTMLScrubber - new module proposal

2006-03-24 Thread Mark Stosberg
On Fri, Mar 24, 2006 at 04:54:05PM +0100, Enrico Sorcinelli wrote:
 Hi all,
 
 I just realized Data::FormValidator::Filters::HTMLScrubber, a simple
 DFV filter that allows to scrub/sanitize html in form field values.
 
 I've attached a temporary POD at the end of the message.
 
 I searched on CPAN and I've not found any similar module (the reason
 why I wrote it). Also I searched over Data::FormVAlidator mailing list
 archives with same result.
 
 Since I would put it on CPAN, any suggestions about the module and/or
 namespace are welcome.

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

I like the API and as the Data::FormValidator maintainer, I welcome this
addition to the Data::FormValidator name space. I suspect I'll use this
contribution myself!

Mark