line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Field::URL; |
2
|
|
|
|
|
|
|
$Form::Processor::Field::URL::VERSION = '1.162360'; |
3
|
1
|
|
|
1
|
|
860
|
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
|
|
|
|
|
409
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub validate { |
10
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
11
|
|
|
|
|
|
|
|
12
|
2
|
50
|
|
|
|
5
|
return unless $self->SUPER::validate; |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
|
|
3
|
my $url = $self->input; |
15
|
|
|
|
|
|
|
|
16
|
2
|
100
|
|
|
|
10
|
return $self->add_error( 'Enter a plain url "e.g. http://google.com/"' ) |
17
|
|
|
|
|
|
|
unless $url =~ m{^\w+://[^/\s]+/\S*$}; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
5
|
return 1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# ABSTRACT: Tests that a url looks like a url. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |