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