[Maypole] 2.07 PR

Tony Bowden tony@kasei.com
Tue, 18 Jan 2005 18:20:24 +0000


On Tue, Jan 18, 2005 at 03:10:29PM +0000, Dave Howorth wrote:
> >I don't believe they do behave very differently here.
> I really don't see how to interpret this as not different?

#!/usr/bin/perl

use strict;
use warnings;
use CGI::Untaint;

sub CGI::Untaint::integer::is_valid { shift->value < 20 }

my $h = CGI::Untaint->new({ foo => "foo", bar => 30, baz => 10 });

my $v1 = eval { $h->extract(-as_integer => 'foo') || "undef" } || $h->error;
my $v2 = eval { $h->extract(-as_integer => 'bar') || "undef" } || $h->error;
my $v3 = eval { $h->extract(-as_integer => 'baz') || "undef" } || $h->error;

print "v1 => $v1\n";
print "v2 => $v2\n";
print "v3 => $v3\n";

----

With 1.00:

soto:pts/19 ~ - perl test-untaint
v1 => undef
v2 => undef
v3 => 10

With 1.25:

gundan:pts/12 ~ - perl test-untaint
v1 => undef
v2 => undef
v3 => 10

No difference.

Tony