| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTML::EscapeEvil::AllowAll; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
HTML::EscapeEvil::AllowAll - Escape tag.but all tag allow |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 VERSION |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
0.05 |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNPSIS |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use HTML::EscapeEvil::AllowAll; |
|
16
|
|
|
|
|
|
|
my $escapeallow = HTML::EscapeEvil::AllowAll->new; |
|
17
|
|
|
|
|
|
|
print "script is " , ($escapeallow->allow_script) ? "allow" : "not allow"; |
|
18
|
|
|
|
|
|
|
print "style is " , ($escapeallow->allow_style) ? "allow" : "not allow"; |
|
19
|
|
|
|
|
|
|
$escapeallow->clear; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Only tag where it wants to escape is specified with deny_tags method etc. |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
and it uses it because it all enters the state of permission. |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
|
28
|
|
|
|
|
|
|
|
|
29
|
4
|
|
|
4
|
|
82525
|
use strict; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
151
|
|
|
30
|
4
|
|
|
4
|
|
24
|
use base qw(HTML::EscapeEvil); |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
4085
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
our $VERSION = 0.05; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=pod |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 METHOD |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 new |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Create HTML::EscapeEvil::AllowAll instance. |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub new { |
|
45
|
|
|
|
|
|
|
|
|
46
|
3
|
|
|
3
|
1
|
49
|
my $class = shift; |
|
47
|
3
|
|
|
|
|
46
|
my $self = $class->SUPER::new; |
|
48
|
3
|
|
33
|
|
|
491
|
bless $self, ref $class || $class; |
|
49
|
3
|
|
|
|
|
10
|
$self->{_tag_map} = []; |
|
50
|
3
|
|
|
|
|
14
|
$self->_init; |
|
51
|
3
|
|
|
|
|
18
|
$self->allow_all; |
|
52
|
3
|
|
|
|
|
1060
|
$self; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=pod |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 allow_all |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
All tags allow. |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Example : |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
$escapeallow->allow_all; |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub allow_all { |
|
68
|
|
|
|
|
|
|
|
|
69
|
3
|
|
|
3
|
1
|
7
|
my $self = shift; |
|
70
|
3
|
|
|
|
|
30
|
$self->allow_comment(1); |
|
71
|
3
|
|
|
|
|
84
|
$self->allow_declaration(1); |
|
72
|
3
|
|
|
|
|
52
|
$self->allow_process(1); |
|
73
|
3
|
|
|
|
|
47
|
$self->allow_entity_reference(1); |
|
74
|
3
|
|
|
|
|
45
|
$self->collection_process(1); |
|
75
|
|
|
|
|
|
|
|
|
76
|
3
|
|
|
|
|
33
|
$self->add_allow_tags( $self->_to_flat_array ); |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=pod |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 _to_flat_array |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Private method. |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub _to_flat_array { |
|
88
|
|
|
|
|
|
|
|
|
89
|
3
|
|
|
3
|
|
6
|
map { @{$_} } @{shift->{_tag_map}}; |
|
|
60
|
|
|
|
|
74
|
|
|
|
60
|
|
|
|
|
198
|
|
|
|
3
|
|
|
|
|
10
|
|
|
90
|
|
|
|
|
|
|
} |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=pod |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 _init |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Private method. |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub _init { |
|
101
|
|
|
|
|
|
|
|
|
102
|
3
|
|
|
3
|
|
7
|
my $self = shift; |
|
103
|
3
|
|
|
|
|
97
|
$self->{_tag_map} = [ |
|
104
|
|
|
|
|
|
|
[ "a", "abbr", "acronym", "address", "area" ], |
|
105
|
|
|
|
|
|
|
[ "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button" ], |
|
106
|
|
|
|
|
|
|
[ "caption", "cite", "code", "col", "colgroup" ], |
|
107
|
|
|
|
|
|
|
[ "dd", "del", "dfn", "div", "dl", "dt" ], |
|
108
|
|
|
|
|
|
|
[ "em", "embed" ], |
|
109
|
|
|
|
|
|
|
[ "fieldset", "frameset", "font", "form" ], |
|
110
|
|
|
|
|
|
|
[ "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "html" ], |
|
111
|
|
|
|
|
|
|
[ "i", "iframe", "img", "input", "ins" ], |
|
112
|
|
|
|
|
|
|
[ "kbd" ], |
|
113
|
|
|
|
|
|
|
[ "label", "legend", "li", "link" ], |
|
114
|
|
|
|
|
|
|
[ "map", "meta" ], |
|
115
|
|
|
|
|
|
|
[ "nobr", "noscript" ], |
|
116
|
|
|
|
|
|
|
[ "object", "ol", "optgroup", "option" ], |
|
117
|
|
|
|
|
|
|
[ "p", "param", "pre" ], |
|
118
|
|
|
|
|
|
|
[ "q" ], |
|
119
|
|
|
|
|
|
|
[ "rb", "rbc", "rp", "rt", "rtc", "ruby" ], |
|
120
|
|
|
|
|
|
|
[ "s", "samp", "script", "select", "small", "span", "strong", "strike", "style", "sub", "sup" ], |
|
121
|
|
|
|
|
|
|
[ "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "title", "tr", "tt" ], |
|
122
|
|
|
|
|
|
|
[ "u", "ul" ], |
|
123
|
|
|
|
|
|
|
[ "var" ] |
|
124
|
|
|
|
|
|
|
]; |
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
__END__ |