| 1 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | |||||||||||
| 3 | package HTML::FormFu::Filter::HTMLEscape; | ||||||||||
| 4 | 10 | $HTML::FormFu::Filter::HTMLEscape::VERSION = '2.06'; | |||||||||
| 5 | # ABSTRACT: filter escaping HTML | ||||||||||
| 6 | |||||||||||
| 7 | 10 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 10 | extends 'HTML::FormFu::Filter'; | |||||||||
| 9 | |||||||||||
| 10 | sub filter { | ||||||||||
| 11 | 8 | ▶ | my ( $self, $value ) = @_; | ||||||||
|
Subroutine
filter: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 12 | |||||||||||
| 13 | 8 | ▶ | return if !defined $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | |||||||||||
| 15 | 8 | $value =~ s/&(?!(amp|lt|gt|quot);)/&/g; | |||||||||
| 16 | 8 | $value =~ s/</</g; | |||||||||
| 17 | 8 | $value =~ s/>/>/g; | |||||||||
| 18 | 8 | $value =~ s/"/"/g; | |||||||||
| 19 | |||||||||||
| 20 | 8 | return $value; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 10 | __PACKAGE__->meta->make_immutable; | |||||||||
| 24 | |||||||||||
| 25 | 10 | 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.06 | ||||||||||
| 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 | ||||||||||