Bugzilla – Attachment 89584 Details for
Bug 22781
Fields on patron search results should be html/json filtered
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22781: Test patron's info filtering
Bug-22781-Test-patrons-info-filtering.patch (text/plain), 4.37 KB, created by
Katrin Fischer
on 2019-05-11 09:28:52 UTC
(
hide
)
Description:
Bug 22781: Test patron's info filtering
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-05-11 09:28:52 UTC
Size:
4.37 KB
patch
obsolete
>From d9cac908c04e9fc4a0ef16d7bb63bbace858319f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 May 2019 20:29:05 -0400 >Subject: [PATCH] Bug 22781: Test patron's info filtering >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The patron's data was not correctly escaped actually. > >Test plan: >This is a good value for the whole patchset: <strong>fir's"tname</strong> \123 ⤠>use it for a patron's firstname, then do a search > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/members/tables/members_results.tt | 2 +- > t/db_dependent/selenium/patrons_search.t | 9 +++++++-- > 2 files changed, 8 insertions(+), 3 deletions(-) > >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 4b4129e1ea..0020f7511d 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 >@@ -17,7 +17,7 @@ > "dt_cardnumber": > "[% data.cardnumber | html | $To %]", > "dt_name": >- "<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% 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 %][% IF data.email %]<br/>Email: <a href='mailto:[% data.email | html %]'>[% data.email | html %]</a>[% END %]", >+ "<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 | $To %]</a><br />[% INCLUDE escape_address data = data %][% IF data.email %]<br/>Email: <a href='mailto:[% data.email | html %]'>[% data.email | html %]</a>[% END %]", > "dt_dateofbirth": > "[% data.dateofbirth | $KohaDates %]", > "dt_category": >diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t >index 6cd831118c..8ea5f869ca 100644 >--- a/t/db_dependent/selenium/patrons_search.t >+++ b/t/db_dependent/selenium/patrons_search.t >@@ -40,12 +40,13 @@ my $builder = t::lib::TestBuilder->new; > > our @cleanup; > subtest 'Search patrons' => sub { >- plan tests => 3; >+ plan tests => 4; > > my @patrons; > my $borrowernotes = q|<strong>just 'a" note</strong> \123 â¤|; > my $borrowernotes_displayed = q|just 'a" note \123 â¤|; >- my $branchname = q|<strong>just 'another" library</strong> \123 â¤|; >+ my $branchname = q|<strong>just 'another" library</strong> \123 â¤|; >+ my $firstname = q|<strong>fir's"tname</strong> \123 â¤|; > my $patron_category = $builder->build_object( > { class => 'Koha::Patron::Categories', category_type => 'A' } ); > my $library = $builder->build_object( >@@ -58,6 +59,7 @@ subtest 'Search patrons' => sub { > class => 'Koha::Patrons', > value => { > surname => "test_patron_" . $i++, >+ firstname => $firstname, > categorycode => $patron_category->categorycode, > branchcode => $library->branchcode, > borrowernotes => $borrowernotes, >@@ -73,6 +75,9 @@ subtest 'Search patrons' => sub { > my $first_patron = $patrons[0]; > > my @td = $driver->find_elements('//table[@id="memberresultst"]/tbody/tr/td'); >+ like ($td[2]->get_text, qr[\Q$firstname\E], >+ 'Column "Name" should be the 3rd and contain the firstname correctly filtered' >+ ); > is( $td[5]->get_text, $branchname, > 'Column "Library" should be the 6th and contain the html tags - they have been html filtered' > ); >-- >2.11.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 22781
:
89267
|
89268
|
89269
|
89270
|
89271
|
89395
|
89396
|
89397
|
89398
|
89399
|
89582
|
89583
| 89584 |
89585
|
89586