Bug 22941 - Giving malformed sortfield to list results in Internal Server Error
Summary: Giving malformed sortfield to list results in Internal Server Error
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-20 06:34 UTC by paxed
Modified: 2020-06-04 20:32 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.01


Attachments
Bug 22941: Do not return 500 if sortfield contain parenthesis (1.40 KB, patch)
2019-06-08 19:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22941: Do not return 500 if sortfield contain parenthesis (1.45 KB, patch)
2019-06-13 19:17 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 22941: Do not return 500 if sortfield contain parenthesis (1.51 KB, patch)
2019-06-14 11:01 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2019-05-20 06:34:05 UTC
Giving sortfield a malformed value when viewing lists results in Internal Server Error.
    
eg. virtualshelves/shelves.pl?op=view&shelfnumber=619&sortfield=author(

Note the trailing (
Comment 1 Jonathan Druart 2019-06-08 19:47:09 UTC
Created attachment 90441 [details] [review]
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
Comment 2 Mark Tompsett 2019-06-13 19:17:20 UTC
Created attachment 90583 [details] [review]
Bug 22941: Do not return 500 if sortfield contain parenthesis

Test plan (on staff client of kohadevbox after making a list):
http://localhost:8081/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=1&sortfield=title(&direction=desc

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>
Comment 3 Martin Renvoize 2019-06-14 11:01:38 UTC
Created attachment 90590 [details] [review]
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>
Comment 4 Martin Renvoize 2019-06-14 11:02:04 UTC
Works as expected, no QA script failures.. Passing QA
Comment 5 Martin Renvoize 2019-06-15 07:02:55 UTC
Nice work!

Pushed to master for 19.11.00
Comment 6 Fridolin Somers 2019-06-20 12:27:22 UTC
Pushed to 19.05.x for 19.05.01
Comment 7 Lucas Gass 2019-06-26 16:40:31 UTC
backported to 18.11.x for 18.11.07