Bug 26102: [19.11] Prevent XSS when To.json is used: catalogue/results.tt
To test, perform a search in the catalogue and verify that search term highlighting works correctly. Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
parent
8401cd292c
commit
3c3237ca87
|
|
@ -1,5 +1,6 @@
|
|||
[% USE raw %]
|
||||
[% USE Asset %]
|
||||
[% USE To %]
|
||||
[% USE Koha %]
|
||||
[% USE Biblio %]
|
||||
[% USE KohaDates %]
|
||||
|
|
@ -772,7 +773,7 @@
|
|||
|
||||
[% IF ( query_desc ) %]
|
||||
toHighlight = $("p,span.results_summary,a.title");
|
||||
var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
|
||||
var query_desc = "[% To.json( query_desc ) | html %]",
|
||||
q_array = query_desc.split(" ");
|
||||
// ensure that we don't have "" at the end of the array, which can
|
||||
// break the highlighter
|
||||
|
|
|
|||
Loading…
Reference in New Issue