line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag::Autoescape; |
2
|
9
|
|
|
9
|
|
6241
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
9
|
|
|
9
|
|
20
|
|
|
9
|
|
|
9
|
|
302
|
|
|
9
|
|
|
|
|
47
|
|
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
53
|
|
|
9
|
|
|
|
|
228
|
|
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
355
|
|
3
|
9
|
|
|
9
|
|
46
|
use parent 'DTL::Fast::Tag'; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
73
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$DTL::Fast::TAG_HANDLERS{'autoescape'} = __PACKAGE__; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#@Override |
8
|
23
|
|
|
23
|
0
|
82
|
sub get_close_tag{ return 'endautoescape';} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#@Override |
11
|
|
|
|
|
|
|
sub parse_parameters |
12
|
|
|
|
|
|
|
{ |
13
|
14
|
|
|
14
|
0
|
26
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
14
|
100
|
|
|
|
61
|
if( $self->{'parameter'} eq 'on' ) |
|
|
100
|
|
|
|
|
|
16
|
|
|
|
|
|
|
{ |
17
|
2
|
|
|
|
|
4
|
$self->{'safe'} = 0; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
elsif( $self->{'parameter'} eq 'off' ) |
20
|
|
|
|
|
|
|
{ |
21
|
11
|
|
|
|
|
22
|
$self->{'safe'} = 1; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
else |
24
|
|
|
|
|
|
|
{ |
25
|
1
|
|
|
|
|
8
|
die $self->get_parse_error("autoescape tag undertands only `on` and `off` parameters"); |
26
|
|
|
|
|
|
|
} |
27
|
13
|
|
|
|
|
29
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#@Override |
31
|
|
|
|
|
|
|
sub render |
32
|
|
|
|
|
|
|
{ |
33
|
12
|
|
|
12
|
0
|
25
|
my $self = shift; |
34
|
12
|
|
|
|
|
17
|
my $context = shift; |
35
|
|
|
|
|
|
|
|
36
|
12
|
|
|
|
|
41
|
$context->push_scope()->set('_dtl_safe' => $self->{'safe'}); |
37
|
12
|
|
|
|
|
84
|
my $result = $self->SUPER::render($context); |
38
|
12
|
|
|
|
|
50
|
$context->pop_scope(); |
39
|
|
|
|
|
|
|
|
40
|
12
|
|
|
|
|
56
|
return $result; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |