Bugzilla – Attachment 90590 Details for
Bug 22941
Giving malformed sortfield to list results in Internal Server Error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22941: Do not return 500 if sortfield contain parenthesis
Bug-22941-Do-not-return-500-if-sortfield-contain-p.patch (text/plain), 1.51 KB, created by
Martin Renvoize
on 2019-06-14 11:01:38 UTC
(
hide
)
Description:
Bug 22941: Do not return 500 if sortfield contain parenthesis
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2019-06-14 11:01:38 UTC
Size:
1.51 KB
patch
obsolete
>From 75eedefe3b47eb50fc3d2ba6b7b73b9c91f09d8c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 8 Jun 2019 14:45:33 -0500 >Subject: [PATCH] Bug 22941: Do not return 500 if sortfield contain parenthesis > >Test plan: >Hit /virtualshelves/shelves.pl?op=view&shelfnumber=1&sortfield=author( > >You must not get: >Unmatched ( in regex; marked by <-- HERE in m/^author( <-- HERE $/ at /home/vagrant/kohaclone/virtualshelves/shelves.pl line 236 > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > virtualshelves/shelves.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index 097607c7ee..5fddf374a4 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -234,7 +234,7 @@ if ( $op eq 'view' ) { > if ( $shelf ) { > if ( $shelf->can_be_viewed( $loggedinuser ) ) { > my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting >- $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded ); >+ $sortfield = 'title' unless grep $_ eq $sortfield, qw( title author copyrightdate itemcallnumber dateadded ); > my $direction = $query->param('direction') || 'asc'; > $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; > my ( $rows, $page ); >-- >2.20.1
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 22941
:
90441
|
90583
| 90590