Bugzilla – Attachment 90584 Details for
Bug 17526
OPAC lists sortfield breaks with a `(`
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17526: Change grep to deal with malformed sortfield
Bug-17526-Change-grep-to-deal-with-malformed-sortf.patch (text/plain), 1.39 KB, created by
Mark Tompsett
on 2019-06-13 19:32:54 UTC
(
hide
)
Description:
Bug 17526: Change grep to deal with malformed sortfield
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2019-06-13 19:32:54 UTC
Size:
1.39 KB
patch
obsolete
>From 2ba1a4303e738458b04a153874833dae96f371b3 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 13 Jun 2019 19:27:00 +0000 >Subject: [PATCH] Bug 17526: Change grep to deal with malformed sortfield > >Giving sortfield a malformed value when viewing lists results in >Internal Server Error. > >eg. >http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=1&sortfield=title( > >Note the trailing ( > >Before Patch: kaboom >apply patch >restart >After Patch: No kaboom >--- > opac/opac-shelves.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index d235292875..cca12f2bb2 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -235,7 +235,7 @@ if ( $op eq 'view' ) { > if ( $shelf->can_be_viewed( $loggedinuser ) ) { > $category = $shelf->category; > my $sortfield = $query->param('sortfield') || $shelf->sortfield; # 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 ( $page, $rows ); >-- >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 17526
:
57010
|
57104
|
90584
|
90641
|
90695