From 501544afa71d8b339b122d6d33ae41675d0932a2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Jan 2021 12:20:03 +0100 Subject: [PATCH] Bug 22070: Try to fix encoding and escaping issue on browse result Pretty sure this does not work but in my tests it seems to fix the problem. Note that if there are several pages, the next link won't appear if you are on the last result of the first page. I don't understand why this code is so complicated, couldn't we port what we have on the staff interface (browser.js)? --- opac/opac-detail.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 8b935af155..e6d396786d 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -229,7 +229,6 @@ my $session = get_session($query->cookie("CGISESSID")); my %paging = (previous => {}, next => {}); if ($session->param('busc')) { use C4::Search; - use URI::Escape; # Rebuild the string to store on session # param value is URI encoded and params separator is HTML encode (&) @@ -243,14 +242,14 @@ if ($session->param('busc')) { if ($_ =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|total|offset|offsetSearch|next|previous|count|expand|scan)/) { if (defined($arrParamsBusc->{$_})) { $pasarParams .= '&' if ($j); - $pasarParams .= $_ . '=' . Encode::decode('UTF-8', uri_escape_utf8( $arrParamsBusc->{$_} )); + $pasarParams .= $_ . '=' . $arrParamsBusc->{$_}; $j++; } } else { for my $value (@{$arrParamsBusc->{$_}}) { next if !defined($value); $pasarParams .= '&' if ($j); - $pasarParams .= $_ . '=' . Encode::decode('UTF-8', uri_escape_utf8($value)); + $pasarParams .= $_ . '=' . $value; $j++; } } @@ -314,12 +313,12 @@ if ($session->param('busc')) { for (@arrBusc) { ($key, $value) = split(/=/, $_, 2); if ($key =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|next|previous|total|offset|offsetSearch|count|expand|scan)/) { - $arrParamsBusc{$key} = uri_unescape($value); + $arrParamsBusc{$key} = $value; } else { unless (exists($arrParamsBusc{$key})) { $arrParamsBusc{$key} = []; } - push @{$arrParamsBusc{$key}}, uri_unescape($value); + push @{$arrParamsBusc{$key}}, $value; } } my $searchAgain = 0; -- 2.20.1