Maybe i'm missing it, but they don't seem to be handled at all (which is a shortcoming)
E:\>perl - 1=a 1=b 1=c 1=d use CGI qw[ param Vars ]; use CGI::Untaint; my $u = CGI::Untaint->new( Vars() ); print "$_\n" for $u->extract(-as_printable => 1); warn 1; print "$_\n" for param(1); __END__ 1 at - line 5. a b c d
Mutliple values do work, though it's not quite how you might expect. Since you're populating your instance of CGI::Untaint using CGI's Vars method, things that have multiple values are seperated by NUL (\0), as documented in the CGI perldoc.
What I normally do in this situation is have my _untaint_re check that each of the things seperated by \0 match what I'm checking, and then have my is_valid do a quick
I think Data::FormValidator is also a very strong contender in this problem space. It handles multiple values, something podmaster brought up in another post. It also integrates with CGI.pm, Regexp::Common and is generally very powerful and flexible.
The current version includes a nice file upload validator as well.
what about multiple values? (Score:1)
E:\>perl - 1=a 1=b 1=c 1=d
use CGI qw[ param Vars ];
use CGI::Untaint;
my $u = CGI::Untaint->new( Vars() );
print "$_\n" for $u->extract(-as_printable => 1);
warn 1;
print "$_\n" for param(1);
__END__
1 at - line 5.
a
b
c
d
Re:what about multiple values? (Score:1)
I was talking about the 1st, CGI::Untaint (obviously). I think it does hit the hammer, but not exactly on the head :)(face maybe, shoulder?)
Re:what about multiple values? (Score:2)
What I normally do in this situation is have my _untaint_re check that each of the things seperated by \0 match what I'm checking, and then have my is_valid do a quick
Re:what about multiple values? (Score:3, Informative)
Re:what about multiple values? (Score:2, Insightful)
Re:what about multiple values? (Score:1)
SEE ALSO: Data::FormValidator (Score:2, Informative)
The current version includes a nice file upload validator as well.
http://search.cpan.org/perldoc?Data::FormValidator
http://mark.stosberg.com/
disclaimer: I maintain Data::FormValidator
Re:SEE ALSO: Data::FormValidator (Score:1)