From 348d84ea7f2255ec8ceee3976ea5370ca25230f4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Nov 2019 08:55:30 +0100 Subject: [PATCH] Bug 23777: Use To.json in preferences.tt Test plan: Search for "foo bar" (with double quotes) in the sysprefs Signed-off-by: Hayley Mapley Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt index 764f1645d9..ae22e006ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -1,4 +1,5 @@ [% USE raw %] +[% USE To %] [% USE Asset %] [% USE Koha %] [% SET footerjs = 1 %] @@ -196,7 +197,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 ) | $raw %]"; var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %]; var MSG_NOTHING_TO_SAVE = _("Nothing to save"); var MSG_SAVING = _("Saving..."); -- 2.39.5