Bugzilla – Attachment 75890 Details for
Bug 20891
Lists in staff don't load when \ was used in the description
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20891: Escape list's names in JSON
Bug-20891-Escape-lists-names-in-JSON.patch (text/plain), 2.42 KB, created by
Marcel de Rooy
on 2018-06-08 05:51:54 UTC
(
hide
)
Description:
Bug 20891: Escape list's names in JSON
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-06-08 05:51:54 UTC
Size:
2.42 KB
patch
obsolete
>From 2b1bab65d9669578ee601c6b32fdc0b0a4e0b5b7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 7 Jun 2018 12:17:26 -0300 >Subject: [PATCH] Bug 20891: Escape list's names in JSON >Content-Type: text/plain; charset=utf-8 > >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 "<script>alert('hola');</script>" >- 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 <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/modules/virtualshelves/tables/shelves_results.tt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >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 2593a7a..4c2c48c 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 >@@ -10,13 +10,13 @@ > "dt_type": > "[% data.type %]", > "dt_shelfname": >- "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber %]'>[% data.shelfname | html%]</a>", >+ "<a href='/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% data.shelfnumber %]'>[% To.json(data.shelfname) | html%]</a>", > "dt_count": > "[% data.count %] item(s)", > "dt_is_shared": > "[% IF data.type == 2 %]Public[% ELSIF data.is_shared %]Shared[% ELSE %]Private[% END %]", > "dt_owner": >- "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner %]'>[% data.firstname %] [% data.surname %]</a>", >+ "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner %]'>[% To.json(data.firstname) | html %] [% To.json(data.surname) | html %]</a>", > "dt_sortby": > [% IF data.sortby == "author" %]"Author"[% ELSIF data.sortby == "copyrightdate" %]"Year"[% ELSIF data.sortby == "itemcallnumber" %]"Call number"[% ELSE %]"Title"[% END %], > "dt_created_on": >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20891
:
75887
|
75890
|
75922
|
88637
|
88638
|
88675
|
88676