line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Validation::Constraints::Path; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
518
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
80
|
use Data::Validation::Constants qw( EXCEPTION_CLASS FALSE TRUE ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
236
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends q(Data::Validation::Constraints); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
EXCEPTION_CLASS->add_exception( 'ValidPath', { |
11
|
|
|
|
|
|
|
parents => [ 'InvalidParameter' ], |
12
|
|
|
|
|
|
|
error => 'Parameter [_1] is not a valid pathname' } ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub validate { |
15
|
7
|
100
|
|
7
|
1
|
11
|
my ($self, $val) = @_; return $val !~ m{ [;&*{} ] }mx ? TRUE : FALSE; |
|
7
|
|
|
|
|
29
|
|
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
1; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Local Variables: |
21
|
|
|
|
|
|
|
# mode: perl |
22
|
|
|
|
|
|
|
# tab-width: 3 |
23
|
|
|
|
|
|
|
# End: |