diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-11-26 17:09:56 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-12-09 09:38:03 +0000 |
commit | 6c2d3d5a7d84521d34daa2cf7e4be76a54b3b0e0 (patch) | |
tree | 75ef8cd6e1df444572ae5ec3a4048e6c3366a088 /perllib/FixMyStreet/App/Controller/Contact.pm | |
parent | a4290acdff6781979cc3cd7c0142d553236e5666 (diff) |
Switch to default-escaped in templates.
This means any variable used in a template is automatically
HTML-escaped, unless it is marked as safe either in code by
using a SafeString, or in the template with the `mark_safe`
function or the `safe` filter.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Contact.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Contact.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm index 8477dd694..9ce89a9e2 100644 --- a/perllib/FixMyStreet/App/Controller/Contact.pm +++ b/perllib/FixMyStreet/App/Controller/Contact.pm @@ -7,6 +7,7 @@ BEGIN { extends 'Catalyst::Controller'; } use MIME::Base64; use mySociety::EmailUtil; use FixMyStreet::Email; +use FixMyStreet::Template::SafeString; =head1 NAME @@ -253,8 +254,9 @@ generally required to stash sub setup_request : Private { my ( $self, $c ) = @_; - $c->stash->{contact_email} = $c->cobrand->contact_email; - $c->stash->{contact_email} =~ s/\@/@/; + my $email = $c->cobrand->contact_email; + $email =~ s/\@/@/; + $c->stash->{contact_email} = FixMyStreet::Template::SafeString->new($email); for my $param (qw/em subject message/) { $c->stash->{$param} = $c->get_param($param); |