line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Field::Email; |
2
|
|
|
|
|
|
|
$Form::Processor::Field::Email::VERSION = '1.162360'; |
3
|
1
|
|
|
1
|
|
492
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
3
|
use base 'Form::Processor::Field::Text'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
382
|
|
6
|
1
|
|
|
1
|
|
7
|
use Email::Valid; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
83
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
0
|
6
|
sub init_size {254} # http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
3
|
|
|
3
|
1
|
2
|
my $self = shift; |
15
|
|
|
|
|
|
|
|
16
|
3
|
50
|
|
|
|
8
|
return unless $self->SUPER::validate; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
3
|
|
|
|
|
18
|
my $email = Email::Valid->address( $self->input ); |
20
|
|
|
|
|
|
|
|
21
|
3
|
100
|
|
|
|
1610
|
return $self->add_error( 'Email should be of the format [_1]', 'someuser@example.com' ) |
22
|
|
|
|
|
|
|
unless $email; |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
6
|
$self->input( lc $email ); |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
6
|
return 1; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# ABSTRACT: Validates email uisng Email::Valid |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |