| HTML-FormFu documentation | Contained in the HTML-FormFu distribution. |
HTML::FormFu::Filter::HTMLEscape - filter escaping HTML
HTML escaping filter.
Carl Franks, cfranks@cpan.org
Based on the original source code of HTML::Widget::Filter::HTMLEscape, by
Lyo Kato, lyo.kato@gmail.com
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| HTML-FormFu documentation | Contained in the HTML-FormFu distribution. |
package HTML::FormFu::Filter::HTMLEscape; use Moose; extends 'HTML::FormFu::Filter'; sub filter { my ( $self, $value ) = @_; return if !defined $value; $value =~ s/&(?!(amp|lt|gt|quot);)/&/g; $value =~ s/</</g; $value =~ s/>/>/g; $value =~ s/"/"/g; return $value; } __PACKAGE__->meta->make_immutable; 1; __END__