Bug 9504

Summary: URL escape in OPAC more searches
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: OPACAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: chris, mtj
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37573
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch
Bug 9504: URL escape in OPAC more searches
Bug 9504: URL escape in OPAC more searches

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