Bug 12885 - Search fails with errors when HTML5 Media is enabled and url has plus (+) characters
Summary: Search fails with errors when HTML5 Media is enabled and url has plus (+) cha...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-08 12:53 UTC by Kyle M Hall (khall)
Modified: 2016-06-21 21:38 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 12885: Fix if url contains +*... and HTML5 Media is enabled (1.02 KB, patch)
2015-07-15 11:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12885: Fix if url contains +*... and HTML5 Media is enabled (1.08 KB, patch)
2015-07-28 08:07 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 12885: Fix if url contains +*... and HTML5 Media is enabled (1.22 KB, patch)
2015-08-17 06:10 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
[PASSED QA] Bug 12885: Fix if url contains +*... and HTML5 Media is enabled (1.29 KB, patch)
2015-09-01 21:52 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2014-09-08 12:53:02 UTC
For example, the following URL in 856$u:

http://www.mrqe.com/lookup?talented+mr.+ripley

will trigger the following error:

Quantifier follows nothing in regex; marked by <-- HERE in m/+ <-- HERE ripley/ at /var/lib/koha/coos/kohaclone/C4/HTML5Media.pm line 113.

This will make all searches where the record in question is in the results impossible. You will get the error instead of search results.
Comment 1 Jonathan Druart 2015-07-15 11:51:52 UTC Comment hidden (obsolete)
Comment 2 Mirko Tietgen 2015-07-28 08:07:35 UTC Comment hidden (obsolete)
Comment 3 Joonas Kylmälä 2015-08-17 06:10:39 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2015-09-01 21:52:02 UTC
Created attachment 42182 [details] [review]
[PASSED QA] Bug 12885: Fix if url contains +*... and HTML5 Media is enabled

The special regex chars are not escaped in C4::HTML5Media.

Test plan:
1/ Set 856$u=http://www.mrqe.com/lookup?talented+mr.+ripley
2/ Enable the pref HTML5Media
3/ Go on the detail page
It should not explode.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi (tcohen) 2015-09-02 17:48:08 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 6 Chris Cormack 2015-09-22 01:37:16 UTC
Pushed to 3.20.x will be in 3.20.4
Comment 7 Liz Rea 2015-09-22 02:29:20 UTC
Pushed to 3.18.x will be in 3.18.11.