Egg::Plugin::Filter - Request query is straightened..
# Your control file. package [MYPROJECT]; use strict; use Egg qw/-Debug Filter/;
* This is code.
$e->filter( { myname => [qw/hold_html abs_strip trim/], address=> [qw/hold_html crlf1 abs_strip trim/], tel => [qw/hold phone/], } ); my $cookie= $e->filter( { nick_name=> [qw/strip_html abs_strip trim/], email => [qw/hold_html hold/], }, $e->request->cookies );
This module makes it easy though the code in which the request query is straightened is very annoying.
The filter processing is executed.
Space is erased before and behind the value.
All the space characters are erased.
Space character is replaced with all one space.
All tabs are erased.
Tab is substituted for one space.
Tab is substituted for one space. In addition, the effort to settle the space in one completely is done.
All crlf are erased.
crlf is substituted for one space.
crlf is substituted for one space. In addition, the effort to settle the space in one completely is done.
Two or more crlf is adjusted to one.
Two or more crlf is adjusted to two.
Two or more crlf is adjusted to three.
All HTML tag are erased.
HTML tag is substituted for one space.
HTML tag is substituted for one space. In addition, the effort to settle the space in one completely is done.
It invalidates it escaping in HTML Tag.
digits characters is left.
alphanumerical character is left.
integer is left.
positive integer is left.
negative integer is left.
decimal is left.
positive decimal is left.
negative decimal is left.
express dollars like currency is left.
Everything lowercases word.
Everything is replaced with the capital letter.
Only the first character is replaced with the capital letter.
Only the character used for the telephone number is left.
The asterisk is replaced with the wild-card for SQL.
It escapes in the meta tag for the regular expression.
The function to build in the filter of making by oneself as a plugin is supported.
Example:
# # This is an original filter module. # package [MY_FILTER]; use strict; # # 'filters' becomes a method to which 'Egg::Plugin::Filter' refers. # sub filters { { # $value = Scalar reference. $args = Array reference. filter1=> sub { my($e, $value, $args)= @_; .... ban, ban. }, filter2=> sub { my($e, $value, $args)= @_; .... won, won. }, }; } # # Configuration is setup. # plugin_filter=> { plugins=> [qw/[MY_FILTER]/], },
Complete.
It referred to the code of 'HTML::FormValidator' partially.
Egg::Release, HTML::FormValidator,
Masatoshi Mizuno, <mizuno@bomcity.com>
Copyright (C) 2006 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.
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.6 or, at your option, any later version of Perl 5 you may have available.
To install Egg::Release, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::Release
CPAN shell
perl -MCPAN -e shell install Egg::Release
For more information on module installation, please visit the detailed CPAN module installation guide.