line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Liberal::Remedy::NestedCDATA; |
2
|
2
|
|
|
2
|
|
1125
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
70
|
|
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
7
|
use HTML::Entities qw( encode_entities ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
410
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub apply { |
7
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
8
|
0
|
|
|
|
|
|
my($driver, $error, $xml_ref) = @_; |
9
|
|
|
|
|
|
|
|
10
|
0
|
0
|
|
|
|
|
return 0 if $error->message !~ /^parser error : Opening and ending tag mismatch:/; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
while ($$xml_ref =~ /(?<= )/xmsg) { |
13
|
0
|
|
|
|
|
|
my ($cdata, $start, $end) = ($1, $-[1], $+[1]); |
14
|
0
|
0
|
|
|
|
|
next if $cdata !~ /
|
15
|
0
|
|
|
|
|
|
my $escaped = encode_entities($cdata, '<>&'); |
16
|
0
|
|
|
|
|
|
substr($$xml_ref, $start, $end - $start) = "]]>$escaped
|
17
|
0
|
|
|
|
|
|
return 1; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return 0; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |