line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Stash::EscapeHTML; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
45197
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
81
|
|
4
|
2
|
|
|
2
|
|
1687
|
use Template::Config; |
|
2
|
|
|
|
|
14322
|
|
|
2
|
|
|
|
|
73
|
|
5
|
2
|
|
|
2
|
|
23
|
use base ($Template::Config::STASH); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
2170
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub get { |
9
|
7
|
|
|
7
|
1
|
58326
|
my($self, @args) = @_; |
10
|
7
|
|
|
|
|
92
|
my($var) = $self->SUPER::get(@args); |
11
|
7
|
100
|
|
|
|
38
|
unless (ref($var)) { |
12
|
6
|
|
|
|
|
11
|
return html_filter($var); |
13
|
|
|
|
|
|
|
} |
14
|
1
|
|
|
|
|
4
|
return $var; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub html_filter { |
18
|
6
|
|
|
6
|
0
|
13
|
my $text = shift; |
19
|
6
|
|
|
|
|
10
|
for ($text) { |
20
|
6
|
|
|
|
|
11
|
s/&/&/g; |
21
|
6
|
|
|
|
|
14
|
s/</g; |
22
|
6
|
|
|
|
|
15
|
s/>/>/g; |
23
|
6
|
|
|
|
|
12
|
s/"/"/g; |
24
|
6
|
|
|
|
|
19
|
s/'/'/g; |
25
|
|
|
|
|
|
|
} |
26
|
6
|
|
|
|
|
26
|
return $text; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |