From 288ef824616fff1bb8a685a43efed3a3f7654f30 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=utf8 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. JK: remove period from commit title Signed-off-by: Joonas Kylmälä Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- 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.39.5