line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Plugin::StripScripts; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
35715
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
5
|
1
|
|
|
1
|
|
916
|
use HTML::StripScripts::Parser; |
|
1
|
|
|
|
|
46013
|
|
|
1
|
|
|
|
|
136
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.1'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub strip_scripts { |
10
|
0
|
|
|
0
|
0
|
|
my $c = shift; |
11
|
0
|
|
|
|
|
|
my $html = shift; |
12
|
|
|
|
|
|
|
|
13
|
0
|
0
|
|
|
|
|
return if !$html; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $config = $c->config->{strip_scripts}; |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
return if !ref($config) eq 'ARRAY'; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $hss = HTML::StripScripts::Parser->new(@$config); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
return $hss->filter_html($html); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |