Bugzilla – Attachment 48786 Details for
Bug 15722
Patron search cannot deal with hidden characters ( tabs ) in fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15722: Escape patron infos for JSON in patron searches
Bug-15722-Escape-patron-infos-for-JSON-in-patron-s.patch (text/plain), 6.50 KB, created by
Jonathan Druart
on 2016-03-08 14:13:54 UTC
(
hide
)
Description:
Bug 15722: Escape patron infos for JSON in patron searches
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-08 14:13:54 UTC
Size:
6.50 KB
patch
obsolete
>From 91c4103af52e80cc6b009745fd966105675d0d81 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 8 Mar 2016 14:09:09 +0000 >Subject: [PATCH] Bug 15722: Escape patron infos for JSON in patron searches > >If patron infos contain invalid JSON chars (\t for instance), the >results won't appear. >The solution is to escape these info. > >Test plan: >Edit patron infos in DB (update borrowers set surname="foobar\t" where >borrowernumber=42) >Search for foobar (you should have more than 1 result) >Without this patch, DT retrieves a bad formatted JSON and the results >won't appear. >With this patch, the table result appears >--- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/tables/members_results.tt | 2 +- > .../intranet-tmpl/prog/en/modules/members/tables/members_results.tt | 2 +- > .../intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt | 2 +- > .../intranet-tmpl/prog/en/modules/serials/tables/members_results.tt | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/tables/members_results.tt >index 681f1cd..ef325f3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/tables/members_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/tables/members_results.tt >@@ -9,7 +9,7 @@ > "dt_cardnumber": > "[% data.cardnumber %]", > "dt_name": >- "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]</a></span>", >+ "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = To.json(data.firstname) surname = To.json(data.surname) othernames = To.json(data.othernames) cardnumber = data.cardnumber invert_name = 1%]</a></span>", > "dt_branch": > "[% data.branchname |html %]", > "dt_category": >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >index 930fdc7..fc5530a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >@@ -15,7 +15,7 @@ > "dt_cardnumber": > "[% data.cardnumber | html %]", > "dt_name": >- "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 %]</a><br />[% INCLUDE escape_address data = data %]</span>", >+ "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = To.json(data.firstname) surname = To.json(data.surname) othernames = To.json(data.othernames) invert_name = 1 %]</a><br />[% INCLUDE escape_address data = data %]</span>", > "dt_dateofbirth": > "[% data.dateofbirth | $KohaDates %]", > "dt_category": >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt >index cbe741b..087aa8c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/tables/members_results.tt >@@ -9,7 +9,7 @@ > "dt_cardnumber": > "[% data.cardnumber %]", > "dt_name": >- "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]</a></span>", >+ "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = To.json(data.firstname) surname = To.json(data.surname) othernames = To.json(data.othernames) cardnumber = data.cardnumber invert_name = 1%]</a></span>", > "dt_category": > "[% data.category_description |html %] ([% data.category_type |html %])", > "dt_branch": >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/tables/members_results.tt >index 840b391..b5096c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/tables/members_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/tables/members_results.tt >@@ -9,7 +9,7 @@ > "dt_cardnumber": > "[% data.cardnumber %]", > "dt_name": >- "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]</a></span>", >+ "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = To.json(data.firstname) surname = To.jon(data.surname) othernames = To.json(data.othernames) cardnumber = data.cardnumber invert_name = 1%]</a></span>", > "dt_branch": > "[% data.branchname |html %]", > "dt_action": >-- >2.7.0
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 15722
:
48786
|
48789
|
49517
|
49518