line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Untaint::zipcode; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
25008
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use base 'CGI::Untaint::object'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1461
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
334
|
use vars qw/$VERSION/; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
108
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub _untaint_re { |
12
|
|
|
|
|
|
|
|
13
|
60
|
|
|
60
|
|
16451
|
return qr/^(\d{5}(-\d{4})?)$/; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
CGI::Untaint::zipcode - validate a US zipcode |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use CGI::Untaint; |
24
|
|
|
|
|
|
|
my $handler = CGI::Untaint->new($q->Vars); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $zipcode = $handler->extract( -as_zipcode => 'zip' ); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This CGI::Untaint input handler verifies that it is dealing with a |
31
|
|
|
|
|
|
|
reasonable United States zipcode, in either the five- or nine-digit |
32
|
|
|
|
|
|
|
format. It does not check whether the zipcode is real. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SEE ALSO |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
L |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 AUTHOR |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Jesse Sheidlower, C |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 COPYRIGHT |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Copyright (C) 2004 Jesse Sheidlower. All rights reserved. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify |
47
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |