Bug 26102: Prevent XSS when To.json is used: admin/preferences.tt

Test that preference search term highlighting works correctly.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5df95693f9)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit b4b87a3091a38985d13f2a6d2eb243589ec8b7dd)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Owen Leonard 2020-08-11 12:31:26 +00:00 committed by Wainui Witika-Park
parent b257f25b1b
commit f2063ecd9f
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@
});
// This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
var to_highlight = "[% To.json( searchfield ) | html %]";
var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
var MSG_NOTHING_TO_SAVE = _("Nothing to save");
var MSG_SAVING = _("Saving...");