Marcus Ramberg > MojoMojo-0.999029 > MojoMojo::Formatter::Defang

Download:
MojoMojo-0.999029.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: MojoMojo-0.999041

NAME ^

MojoMojo::Formatter::Defang - Scrub user HTML 1 =head1 DESCRIPTION

This formatter makes sure only a safe range of tags are allowed, using HTML::Defang; It also tries to remove XSS attempts.

METHODS ^

format_content_order

Format order can be 1-99. The Defang formatter runs on 16, just after the main formatter, in order to catch direct user input. Defang trusts the main formatter and all subsequently ran plugins to not output unsafe HTML.

defang_tags_callback

Callback for custom handling specific HTML tags

defang_url_callback

Callback for custom handling URLs in HTML attributes as well as styletag/attribute declarations

defang_css_callback

Callback for custom handling style tags/attributes

Callback for custom handling HTML tag attributes

format_content

calls the formatter. Takes a ref to the content as well as the context object.

SEE ALSO ^

MojoMojo,Module::Pluggable::Ordered,HTML::Defang

AUTHORS ^

Marcus Ramberg <mramberg@cpan.org>

LICENSE ^

This module is licensed under the same terms as Perl itself.