line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Untaint::email; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
9496
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
46
|
|
4
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.03'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
18
|
use base qw(CGI::Untaint::printable); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1296
|
|
8
|
1
|
|
|
1
|
|
3597
|
use Email::Valid; |
|
1
|
|
|
|
|
157044
|
|
|
1
|
|
|
|
|
18
|
|
9
|
1
|
|
|
1
|
|
58
|
use Mail::Address; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $validator = Email::Valid->new( |
12
|
|
|
|
|
|
|
-fudge => 0, |
13
|
|
|
|
|
|
|
-fqdn => 1, |
14
|
|
|
|
|
|
|
-local_rules => 0, |
15
|
|
|
|
|
|
|
-mxcheck => 0, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub is_valid { |
19
|
3
|
|
|
3
|
1
|
2980
|
my $self = shift; |
20
|
3
|
100
|
|
|
|
10
|
if ($validator->address($self->value)) { |
21
|
2
|
|
|
|
|
2595
|
my @address = Mail::Address::overload->parse($self->value); |
22
|
2
|
|
|
|
|
327
|
return $self->value($address[0]); |
23
|
|
|
|
|
|
|
} |
24
|
1
|
|
|
|
|
105
|
return; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
package Mail::Address::overload; |
28
|
1
|
|
|
1
|
|
165
|
use base qw(Mail::Address); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
147
|
|
29
|
|
|
|
|
|
|
use overload |
30
|
2
|
|
|
2
|
|
399
|
'""' => sub { $_[0]->format }, |
31
|
1
|
|
|
1
|
|
8
|
fallback => 1; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
28
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |