line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Escape::PurePerl; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
die qq{Don't use HTML::Escape::PurePerl directly, use HTML::Escape instead.\n} # ' for poor editors |
7
|
|
|
|
|
|
|
if caller() ne 'HTML::Escape'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package # do not index, pause. |
10
|
|
|
|
|
|
|
HTML::Escape; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our %_escape_table = ( '&' => '&', '>' => '>', '<' => '<', q{"} => '"', q{'} => ''', q{`} => '`', '{' => '{', '}' => '}' ); |
13
|
|
|
|
|
|
|
sub escape_html { |
14
|
5
|
|
|
5
|
0
|
14
|
my $str = shift; |
15
|
5
|
50
|
|
|
|
13
|
return '' |
16
|
|
|
|
|
|
|
unless defined $str; |
17
|
5
|
|
|
|
|
47
|
$str =~ s/([&><"'`{}])/$_escape_table{$1}/ge; #' for poor editors |
|
7
|
|
|
|
|
31
|
|
18
|
5
|
|
|
|
|
22
|
return $str; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|