From 2ff14bae1565ca95b81f3aea9a689068f717e18d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Nov 2019 09:24:42 +0100 Subject: [PATCH] Bug 23777: Use To.json in results.tt Test plan: Search for a string with quote and confirm that it is correctly highlighted in the result list. Signed-off-by: Hayley Mapley Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index e618d73079..b015de5120 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -1,4 +1,5 @@ [% USE raw %] +[% USE To %] [% USE Asset %] [% USE Koha %] [% USE Biblio %] @@ -703,7 +704,7 @@ [%- END -%] var search_result = { - query_desc: "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]", + var query_desc = "[% To.json( query_desc ) | $raw %]"; query_cgi: "[% query_cgi | html %]", limit_cgi: "[% limit_cgi | html %]", sort_cgi: "[% sort_cgi | html %]", -- 2.39.5