From: Dan Scott Date: Thu, 6 Sep 2012 16:25:01 +0000 (-0400) Subject: TPAC: Escape single quotes in MFHD record location X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f40d901d7e95d710c9814740af12120c5641eadb;p=working%2FEvergreen.git TPAC: Escape single quotes in MFHD record location If an MFHD record contains an 852 field with a subfield containing a single quote, the unescaped single quote is introduced directly into the value of the JavaScript hash that uses single quotes as delimiters - thereby generating a JS exception and preventing the staff client from properly populating the MFHD Editor menu. This commit escapes incoming single quotes from the MFHD location field to prevent that from happening. The other fields in the JS hash are numeric and therefore should not need escaping. Signed-off-by: Dan Scott Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Dan Wells Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index 72f0caa76c..fb500c7216 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -23,7 +23,7 @@ [% FOR summary IN ctx.mfhd_summaries %] { 'id' : '[% summary.sre_id %]', - 'label' : '[% summary.location %]', + 'label' : '[% summary.location | replace("'", "\\'") %]', 'entryNum' : '[% loop.index %]', 'owning_lib' : '[% summary.owning_lib %]' },