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