Bug 26102: [19.11] Prevent XSS when To.json is used: authorities/blinddetail-biblio-search.tt

Test the process of searching for and selecting an authority record for
use in the basic MARC editor.

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Owen Leonard 2020-08-11 12:41:13 +00:00 committed by Wainui Witika-Park
parent b4dbedbcd4
commit 8401cd292c
1 changed files with 7 additions and 6 deletions

View File

@ -1,3 +1,4 @@
[% USE To %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Authority details</title>
@ -30,12 +31,12 @@
var new_line = "";
[% ELSE %]
var new_line = "
[%- FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP -%]‡
[%- SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r ') | html -%]
[%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
[%- marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html -%]
[%- END -%]
[%- END -%]‡9[% authid | html %]";
[%- FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP -%]‡
[%- To.json( SUBFIELD_LOO.marc_subfield ) | html -%]
[%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
[%- To.json( marc_value ) | html -%]
[%- END -%]
[%- END -%]‡9[% authid | html %]";
[% END %]
RancorReplaceField( new_line, "[% indicator1 | html %]", "[% indicator2 | html %]" );
[% ELSE %]