NAME
Template::Stash::AutoEscape - escape automatically in Template-Toolkit.
SYNOPSIS
use Template;
use Template::Stash::AutoEscape;
my $tt = Template->new({
STASH => Template::Stash::AutoEscape->new
});
METHODS
new
- escape_type
-
default is HTML
- method_for_raw
-
default is raw, you can get not escaped value from [% value.raw %]
- escape_method
-
my $tt = Template->new({ STASH => Template::Stash::AutoEscape->new({ escape_method => sub { my $text = shift; ... ; return $text } }) });
class_for
Template::Stash::AutoEscape->class_for("HTML") # Template::Stash::AutoEscape::Escaped::HTML
Template::Stash::AutoEscape->class_for("HTML" => "MyHTMLString");
DESCRIPTION
Template::Stash::AutoEscape is a sub class of Template::Stash, automatically escape all HTML strings and avoid XSS vulnerability.
AUTHOR
mala <cpan@ma.la>
SEE ALSO
Template, Template::Stash::EscapedHTML
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.