Subject: | cgi_update_errors from empty field of untaint type printable |
this is related to a possible bug in CGI::Untaint, where errors are given for empty values. see http://rt.cpan.org/NoAuth/Bug.html?id=11796
% cat test2.pl
#!/usr/bin/perl
package TestObj;
use base 'Class::DBI::FromCGI';
sub create { "create called with @_" }
sub untaint_type { 'printable' }
package TestApp;
use CGI::Untaint;
my %params = ( foo => 'bar', baz => '');
my $h = CGI::Untaint->new( %params );
my $o = TestObj->create_from_cgi($h => { all => [ qw/foo baz/ ] });
my %errors = $o->cgi_update_errors;
use Data::Dumper; print Dumper \%errors;
% perl test2.pl
$VAR1 = {
'baz' => 'baz () does not untaint with default pattern'
};
(create, of course, is never called if there are cgi_update_errors)
imo, errors on empty strings should only matter if the field is 'required'