From afe173e44791f5886d4348c0f851120d417e4107 Mon Sep 17 00:00:00 2001 From: Petro Vashchuk Date: Fri, 12 Nov 2021 15:14:46 +0200 Subject: [PATCH] Bug 29463: Escape utf8 characters before appending search query to url. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To test: 1) go to the main page of Koha and search in the "Check out" search window type "näyttö". 2) see that umlauts got replaced with replacement characters. 3) apply the patch. 4) repeat 1-2, ensure that umlauts displayed correctly and are not getting replaced with replacement characters. --- circ/circulation.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 261f26dd57..89ccf2a765 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -26,6 +26,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); +use URI::Escape qw( uri_escape_utf8 ); use DateTime; use DateTime::Duration; use Scalar::Util qw( looks_like_number ); @@ -227,7 +228,7 @@ if ($findborrower) { if ( $patron ) { $borrowernumber = $patron->borrowernumber; } else { - print $query->redirect( "/cgi-bin/koha/members/member.pl?quicksearch=1&circsearch=1&searchmember=" . $findborrower ); + print $query->redirect( "/cgi-bin/koha/members/member.pl?quicksearch=1&circsearch=1&searchmember=" . uri_escape_utf8($findborrower) ); exit; } } -- 2.31.1