line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Template::ESCAPE::URL; |
2
|
4
|
|
|
4
|
|
1137
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
164
|
|
3
|
4
|
|
|
4
|
|
20
|
use warnings FATAL => 'all'; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
298
|
|
4
|
4
|
|
|
4
|
|
22
|
use base qw(HTML::Template::ESCAPE); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
395
|
|
5
|
4
|
|
|
4
|
|
21
|
use vars qw(%MAP); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
866
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.9'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub output { |
9
|
24
|
|
|
24
|
0
|
35
|
my $self = shift; |
10
|
24
|
50
|
|
|
|
68
|
$_ = shift if (@_ > 0); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Build a char->hex map if one isn't already available |
13
|
24
|
100
|
|
|
|
70
|
unless (exists($MAP{chr(1)})) { |
14
|
2
|
|
|
|
|
7
|
for (0..255) { $MAP{chr($_)} = sprintf('%%%02X', $_); } |
|
512
|
|
|
|
|
1569
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# do the translation (RFC 2396 ^uric) |
18
|
24
|
|
|
|
|
362
|
s!([^a-zA-Z0-9_.\-])!$MAP{$1}!g; |
19
|
|
|
|
|
|
|
|
20
|
24
|
|
|
|
|
511
|
$_; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |