aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/View
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2015-02-19 16:41:22 +0000
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:23 +0100
commit735536dc5e269f2094d122e49f2c648928db4acb (patch)
tree5779c470d6f326828f0f587f76bfc0841c03144f /perllib/FixMyStreet/App/View
parentd004b2df0c85615eab6924c35f478b45bdf84b2d (diff)
[Zurich] Response templates for report admin.
This provides a ResponseTemplate model that an admin/staff user can choose from when responding to problems. For mysociety/FixMyStreet-Commercial#671.
Diffstat (limited to 'perllib/FixMyStreet/App/View')
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm
index 9cc571efc..37a81e444 100644
--- a/perllib/FixMyStreet/App/View/Web.pm
+++ b/perllib/FixMyStreet/App/View/Web.pm
@@ -133,6 +133,9 @@ sub escape_js {
'>' => 'u003e',
);
$text =~ s/([\\"'<>])/\\$lookup{$1}/g;
+
+ $text =~ s/(?:\r\n|\n|\r)/\\n/g; # replace newlines
+
return $text;
}