From: Jonathan Druart Date: Thu, 7 Jun 2018 15:17:26 +0000 (-0300) Subject: Bug 20891: Escape list's names in JSON X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=2be0195895628ec491ee1f25368e60181c4f1eb2 Bug 20891: Escape list's names in JSON When someone uses \ in the description of a list, the datatable in staff won't load and keeps processing. Test plan: - Create a list named "" - Create another list named "k\o\h\a" - Hit /cgi-bin/koha/virtualshelves/shelves.pl => Without this patch the lists will not be displayed, JSON is malformated => With this patch everything is ok Signed-off-by: Marcel de Rooy Signed-off-by: Liz Rea Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt index 66452ff7..d904057 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt @@ -11,13 +11,13 @@ "dt_type": "[% data.type | html %]", "dt_shelfname": - "[% data.shelfname | html %]", + "[% To.json(data.shelfname) | html%]", "dt_count": "[% data.count | html %] item(s)", "dt_is_shared": "[% IF data.type == 2 %]Public[% ELSIF data.is_shared %]Shared[% ELSE %]Private[% END %]", "dt_owner": - "[% data.firstname | html %] [% data.surname | html %]", + "[% To.json(data.firstname) | html %] [% To.json(data.surname) | html %]", "dt_sortby": [% IF data.sortby == "author" %]"Author"[% ELSIF data.sortby == "copyrightdate" %]"Year"[% ELSIF data.sortby == "itemcallnumber" %]"Call number"[% ELSIF data.sortby == "dateadded" %]"Date added"[% ELSE %]"Title"[% END %], "dt_created_on":