line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
10
|
|
|
10
|
|
806
|
use strict; |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
691
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::FormFu::Filter::HTMLEscape; |
4
|
|
|
|
|
|
|
$HTML::FormFu::Filter::HTMLEscape::VERSION = '2.07'; |
5
|
|
|
|
|
|
|
# ABSTRACT: filter escaping HTML |
6
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
|
70
|
use Moose; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
80
|
|
8
|
|
|
|
|
|
|
extends 'HTML::FormFu::Filter'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub filter { |
11
|
8
|
|
|
8
|
0
|
33
|
my ( $self, $value ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
8
|
50
|
|
|
|
42
|
return if !defined $value; |
14
|
|
|
|
|
|
|
|
15
|
8
|
|
|
|
|
24
|
$value =~ s/&(?!(amp|lt|gt|quot);)/&/g; |
16
|
8
|
|
|
|
|
18
|
$value =~ s/</</g; |
17
|
8
|
|
|
|
|
26
|
$value =~ s/>/>/g; |
18
|
8
|
|
|
|
|
24
|
$value =~ s/"/"/g; |
19
|
|
|
|
|
|
|
|
20
|
8
|
|
|
|
|
28
|
return $value; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=encoding UTF-8 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
HTML::FormFu::Filter::HTMLEscape - filter escaping HTML |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 2.07 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
HTML escaping filter. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 AUTHOR |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Carl Franks, C<cfranks@cpan.org> |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Based on the original source code of L<HTML::Widget::Filter::HTMLEscape>, by |
50
|
|
|
|
|
|
|
Lyo Kato, C<lyo.kato@gmail.com> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 LICENSE |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
55
|
|
|
|
|
|
|
the same terms as Perl itself. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Carl Franks <cpan@fireartist.com> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This software is copyright (c) 2018 by Carl Franks. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
66
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |