Bug 22290 - Next pages results for cyrillic symbols shows decoded text in URL in anchor tag
Summary: Next pages results for cyrillic symbols shows decoded text in URL in anchor tag
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-07 14:29 UTC by Bohdan
Modified: 2019-11-24 22:20 UTC (History)
3 users (show)

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


Attachments
Search encoding (23.04 KB, image/png)
2019-02-07 14:29 UTC, Bohdan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bohdan 2019-02-07 14:29:20 UTC
Created attachment 84849 [details]
Search encoding

This bug is reproduced on OPAC, intranet works fine.
Whenether i enter cyrillic symbols in search, first page results are fine, but the generated HTML page has wrong value in pagination.

Something like this is inside each li>a href element in pagination
/cgi-bin/koha/opac-search.pl?idx=kw&q=%25D1%2588%25D0%25B5%25D0%25B2%25D1%2587%25D0%25B5%25D0%25BD%25D0%25BA%25D0%25BE&offset=20&sort_by=relevance_dsc


If i click search on this link i am redirected to page that shows broken characters as you can see in attachment.
Comment 1 George Veranis 2019-02-18 15:23:11 UTC
Based on https://www.perlmonks.org/bare/?node_id=495747
and that answer 
"
Won't that escape data twice? Without actually running it, it looks like
"\x{1234}"
would be transformed by uri_escape_utf8 into
"%C8%B4"
which would be transformed by POST into
"%25C8%25B4"
while the right answer would be
"%C8%B4"

"

I add the line $query_cgi = Encode::decode_utf8(uri_unescape($query_cgi)); 
at 587 of opac-search.pl and it works
I will try later to do a patch for that.
Comment 2 Bohdan 2019-02-19 09:18:10 UTC
Thank you very much for this!
Comment 3 Katrin Fischer 2019-11-24 22:20:56 UTC
Resetting assignee to default