Bug 9504 - URL escape in OPAC more searches
Summary: URL escape in OPAC more searches
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-29 17:02 UTC by Fridolin Somers
Modified: 2014-05-26 21:04 UTC (History)
2 users (show)

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


Attachments
Proposed patch (7.46 KB, patch)
2013-01-29 17:12 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 9504: URL escape in OPAC more searches (7.60 KB, patch)
2013-02-02 03:25 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 9504: URL escape in OPAC more searches (7.65 KB, patch)
2013-03-20 00:41 UTC, Mason James
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2013-01-29 17:02:41 UTC
OPACSearchForTitleIn is a syspref used to add links as "more searches" in OPAC record detail page.
The links can contain vars depending on record values like title, ISBN, ...
Thoses values must be URL-escaped because they can contain special characters that will brake URL and/or HTML.
Comment 1 Fridolin Somers 2013-01-29 17:12:36 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2013-02-02 03:25:02 UTC Comment hidden (obsolete)
Comment 3 Mason James 2013-03-20 00:41:17 UTC
Created attachment 16446 [details] [review]
Bug 9504: URL escape in OPAC more searches

OPACSearchForTitleIn is a syspref used to add links as "more searches" in OPAC record detail page.
The links can contain vars depending on record values like title, ISBN, ...
Thoses values must be URL-escaped because they can contain special characters that will brake URL and/or HTML.

This patch add a method C4::Output::parametrized_url() that replaces vars in URL usign escape and UTF-8 encoding.

Test plan :
- Define in OPACSearchForTitleIn a link with all possible vars : TITLE, AUTHOR, ISBN, ISSN, CONTROLNUMBER, BIBLIONUMBER
- Edit a record to add special characters in title : ", &, ? ...
- Go to OPAC detail pages of this record
=> Check that URL is well encoded
=> Click on link to check the term is well encoded (diacritical characters, ...)

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Nice test plan, thanks!

Verified bug and fix - both look good.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Comment 4 Mason James 2013-03-20 00:43:51 UTC
> Signed-off-by: Mason James <mtj@kohaaloha.com>

passing QA, patch tested and works well

testing 1 commit(s) (applied to 2f3cf47 'Merge branch 'bug_8979' into 3.12-mas')
Comment 5 Jared Camins-Esakov 2013-03-20 12:37:17 UTC
This patch has been pushed to master.
Comment 6 Chris Cormack 2013-03-29 06:47:04 UTC
Pushed to 3.10.x will be in 3.10.5