line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::XML::Escape; |
2
|
|
|
|
|
|
|
# $Id$ |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
29367
|
use 5.006001; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
39
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
35
|
|
7
|
1
|
|
|
1
|
|
972
|
use Template::Plugin::Filter; |
|
1
|
|
|
|
|
38491
|
|
|
1
|
|
|
|
|
33
|
|
8
|
1
|
|
|
1
|
|
12
|
use base 'Template::Plugin::Filter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
445
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $NAME = 'xml_escape'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init { |
15
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
16
|
0
|
|
0
|
|
|
|
$self->install_filter($self->{_ARGS}->[0] || $NAME); |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub filter { |
22
|
0
|
|
|
0
|
0
|
|
my ($self, $text, undef, $config) = @_; |
23
|
0
|
|
|
|
|
|
$text =~ s/&/&/go; |
24
|
0
|
|
|
|
|
|
$text =~ s/</go; |
25
|
0
|
|
|
|
|
|
$text =~ s/>/>/go; |
26
|
0
|
|
|
|
|
|
$text =~ s/'/'/go; |
27
|
0
|
|
|
|
|
|
$text =~ s/"/"/go; |
28
|
0
|
|
|
|
|
|
return $text; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |