line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
2
|
|
|
2
|
|
1156
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
4
|
2
|
|
|
2
|
|
10
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
use Moo; |
6
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
7
|
2
|
|
|
2
|
|
584
|
use namespace::clean; |
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
11
|
|
8
|
2
|
|
|
2
|
|
63
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
14
|
|
9
|
|
|
|
|
|
|
with 'Dancer2::Plugin::FormValidator::Role::Validator'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use constant { |
12
|
|
|
|
|
|
|
UNICODE => 'u', |
13
|
2
|
|
|
|
|
666
|
ASCII => 'a', |
14
|
|
|
|
|
|
|
}; |
15
|
2
|
|
|
2
|
|
444
|
|
|
2
|
|
|
|
|
4
|
|
16
|
|
|
|
|
|
|
has encoding => ( |
17
|
|
|
|
|
|
|
is => 'rw', |
18
|
|
|
|
|
|
|
default => ASCII, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $encoding = $_[0]->encoding; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
0
|
13
|
if ($encoding eq UNICODE) { |
24
|
|
|
|
|
|
|
return { |
25
|
2
|
100
|
|
|
|
8
|
en => '%s must contain only alphabetical symbols and/or numbers 0-9', |
26
|
|
|
|
|
|
|
ru => '%s должно содержать только символы алфавита или/и цифры 0-9', |
27
|
1
|
|
|
|
|
9
|
de => '%s darf nur alphabetische Symbole und/oder Zahlen 0-9 enthalten', |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
return { |
32
|
|
|
|
|
|
|
en => '%s must contain only latin alphabetical symbols', |
33
|
|
|
|
|
|
|
ru => '%s должно содержать только символы латинского алфавита', |
34
|
1
|
|
|
|
|
8
|
de => '%s darf nur lateinische Zeichen enthalten', |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my ($self, $field, $input, $encoding) = @_; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $regex; |
41
|
4
|
|
|
4
|
0
|
14
|
|
42
|
|
|
|
|
|
|
if (defined $encoding and $encoding eq UNICODE) { |
43
|
4
|
|
|
|
|
5
|
$regex = qr/^\w+$/; |
44
|
|
|
|
|
|
|
$self->encoding(UNICODE); |
45
|
4
|
100
|
66
|
|
|
19
|
} |
46
|
2
|
|
|
|
|
8
|
else { |
47
|
2
|
|
|
|
|
8
|
$regex = qr/^\w+$/a; |
48
|
|
|
|
|
|
|
$self->encoding(ASCII); |
49
|
|
|
|
|
|
|
} |
50
|
2
|
|
|
|
|
7
|
|
51
|
2
|
|
|
|
|
7
|
if ($self->_field_defined_and_non_empty($field, $input)) { |
52
|
|
|
|
|
|
|
return $input->{$field} =~ $regex; |
53
|
|
|
|
|
|
|
} |
54
|
4
|
50
|
|
|
|
13
|
|
55
|
4
|
|
|
|
|
49
|
return 1; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
1; |