in reply to Re: Escaping double quotes in complete document
in thread Escaping double quotes in complete document
This protects you from Cross-Site-Scripting attacks and handles the double quote issue.
Not quite, you're missing the html filter, e.g.:
use Template; my $tt = Template->new(); my $soap = ' "foo" <bar> & '; $tt->process(\<<END, {soap=>$soap}) || die $tt->error(); <html> <input type="text" name="mytext" value="[% soap %]"/> </html> END $tt->process(\<<END, {soap=>$soap}) || die $tt->error(); <html> <input type="text" name="mytext" value="[% soap | html %]"/> </html> END __END__ <html> <input type="text" name="mytext" value=" "foo" <bar> & "/> </html> <html> <input type="text" name="mytext" value=" "foo" <bar> + &amp; "/> </html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Escaping double quotes in complete document
by holli (Abbot) on Jun 27, 2017 at 14:49 UTC |