Apache2-WebApp-Plugin-Filters
view release on metacpan or search on metacpan
my $result = $c->plugin('Filters')->strip_html($markup);
untaint_html
Remove restricted HTML tags and attributes.
my $result = $c->plugin('Filters')->untaint_html($markup);
Supported tags:
a blockquote br dd dl div em font form img input hr h1 h2 h3 h4 h5 h6
label legend li ol option p pre ul script select small span strong style
table tbody tfoot thead tr td
SEE ALSO
Apache2::WebApp, Apache2::WebApp::Plugin, HTML::StripScripts::Parser
AUTHOR
Marc S. Brooks, <mbrooks@cpan.org> - <http://mbrooks.info>
COPYRIGHT
This program is free software; you can redistribute it and/or modify it
lib/Apache2/WebApp/Plugin/Filters.pm view on Meta::CPAN
{ type => OBJECT },
{ type => SCALAR }
);
my $hs = HTML::StripScripts::Parser->new({
AllowHref => 1,
AllowRelURL => 1,
AllowSrc => 1,
BanAllBut => [qw(
a blockquote br dd dl div em font form img input hr h1 h2 h3 h4 h5 h6
label legend li ol option p pre ul script select small span strong style
table tbody tfoot thead tr td
)],
});
my $text = $hs->filter_html($markup);
$text =~ s/<!--filtered-->//g;
return $text;
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~[ PRIVATE METHODS ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
lib/Apache2/WebApp/Plugin/Filters.pm view on Meta::CPAN
=head2 untaint_html
Remove restricted HTML tags and attributes.
my $result = $c->plugin('Filters')->untaint_html($markup);
Supported tags:
a blockquote br dd dl div em font form img input hr h1 h2 h3 h4 h5 h6
label legend li ol option p pre ul script select small span strong style
table tbody tfoot thead tr td
=head1 SEE ALSO
L<Apache2::WebApp>, L<Apache2::WebApp::Plugin>, L<HTML::StripScripts::Parser>
=head1 AUTHOR
Marc S. Brooks, E<lt>mbrooks@cpan.orgE<gt> - L<http://mbrooks.info>
( run in 1.795 second using v1.01-cache-2.11-cpan-39bf76dae61 )