line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Template::Compiled::Classic; |
2
|
1
|
|
|
1
|
|
1061
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
31
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.003'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use base 'HTML::Template::Compiled'; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
79
|
|
7
|
1
|
|
|
1
|
|
369
|
use HTML::Template::Compiled::Compiler::Classic; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
106
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
1
|
16
|
sub compiler_class { 'HTML::Template::Compiled::Compiler::Classic' } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub _get_var_global_sub { |
12
|
4
|
|
|
4
|
|
5
|
my ($self, $P, $ref, $final, @paths) = @_; |
13
|
4
|
|
|
|
|
6
|
my $key = $paths[0]->[1]; |
14
|
4
|
|
100
|
|
|
10
|
my $stack = $self->get_globalstack || []; |
15
|
4
|
|
|
|
|
6
|
for my $item ( $ref, reverse @$stack ) { |
16
|
5
|
100
|
|
|
|
10
|
next unless exists $item->{$key}; |
17
|
4
|
|
|
|
|
4
|
my $var = $item->{$key}; |
18
|
4
|
100
|
|
|
|
11
|
ref $var eq 'CODE' and $var = $var->(); |
19
|
4
|
|
|
|
|
89
|
return $var; |
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
0
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# returns if the var is valid |
25
|
|
|
|
|
|
|
# only allow '.', '/', '+', '-' and '_' |
26
|
|
|
|
|
|
|
# fix 2012-05-14: HTML::Template allows every character |
27
|
|
|
|
|
|
|
# although the documentation says it doesn't. |
28
|
|
|
|
|
|
|
sub validate_var { |
29
|
7
|
|
|
7
|
1
|
14
|
return 1; |
30
|
|
|
|
|
|
|
# return $_[1] !~ tr#a-zA-Z0-9._/-##c; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |