aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-12-11 11:54:51 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-12-12 16:46:37 +0000
commitc049907103c47e279706a319a0d8917ee6c968ab (patch)
tree2766ce490cff12bdff48d6561c54db6c5b604750 /web
parent83744b62b5c55a04a1d513cec2916976f2dafb58 (diff)
Don’t escape entities in report titles via ajax.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 98e538933..100eec15d 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -1354,7 +1354,19 @@ fixmystreet.display = {
}
var found = html.match(/<title>([\s\S]*?)<\/title>/);
- var page_title = found[1];
+ // Unencode HTML entities so it's suitable for document.title. We
+ // only care about the ones encoded by the template's html_filter.
+ var map = {
+ '&amp;': '&',
+ '&gt;': '>',
+ '&lt;': '<',
+ '&quot;': '"',
+ '&#39;': "'"
+ };
+ var page_title = found[1].replace(/&(amp|lt|gt|quot|#39);/g, function(m) {
+ return map[m];
+ });
+
fixmystreet.page = 'report';
$('.big-hide-pins-link').hide();