line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Validation::Constraints::Path; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
850
|
use namespace::autoclean; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
11
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
109
|
use Data::Validation::Constants qw( EXCEPTION_CLASS FALSE TRUE ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
6
|
1
|
|
|
1
|
|
399
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
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
|
18
|
my ($self, $val) = @_; return $val !~ m{ [;&*{} ] }mx ? TRUE : FALSE; |
|
7
|
|
|
|
|
56
|
|
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
1; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Local Variables: |
21
|
|
|
|
|
|
|
# mode: perl |
22
|
|
|
|
|
|
|
# tab-width: 3 |
23
|
|
|
|
|
|
|
# End: |