Bug 11944: Fix problems introduced by bug 11515
The game continue... Patch for bug 11515 introduced regression on this patch set. To reproduce: search with utf8 characters at the opac Test plan: Verify that the issue described on bug 11515 is still fixed and that no regression is found at the OPAC. Note that I am pretty sure this patch is not enough. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
2840c2fa75
commit
f01e616a72
2 changed files with 9 additions and 9 deletions
|
@ -168,13 +168,13 @@ if ($session->param('busc')) {
|
||||||
if ($_ =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|total|offset|offsetSearch|next|previous|count|expand|scan)/) {
|
if ($_ =~ /^(?:query|listBiblios|newlistBiblios|query_type|simple_query|total|offset|offsetSearch|next|previous|count|expand|scan)/) {
|
||||||
if (defined($arrParamsBusc->{$_})) {
|
if (defined($arrParamsBusc->{$_})) {
|
||||||
$pasarParams .= '&' if ($j);
|
$pasarParams .= '&' if ($j);
|
||||||
$pasarParams .= $_ . '=' . uri_escape( $arrParamsBusc->{$_} );
|
$pasarParams .= $_ . '=' . Encode::decode('UTF-8', uri_escape_utf8( $arrParamsBusc->{$_} ));
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for my $value (@{$arrParamsBusc->{$_}}) {
|
for my $value (@{$arrParamsBusc->{$_}}) {
|
||||||
$pasarParams .= '&' if ($j);
|
$pasarParams .= '&' if ($j);
|
||||||
$pasarParams .= $_ . '=' . uri_escape($value);
|
$pasarParams .= $_ . '=' . Encode::decode('UTF-8', uri_escape_utf8($value));
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,7 +356,7 @@ for (keys %$params) {
|
||||||
my @pasarParam = $cgi->param($_);
|
my @pasarParam = $cgi->param($_);
|
||||||
for my $paramValue(@pasarParam) {
|
for my $paramValue(@pasarParam) {
|
||||||
$pasarParams .= '&' if ($j > 0);
|
$pasarParams .= '&' if ($j > 0);
|
||||||
$pasarParams .= $_ . '=' . uri_escape($paramValue);
|
$pasarParams .= $_ . '=' . uri_escape_utf8($paramValue);
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -544,10 +544,10 @@ if ($tag) {
|
||||||
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
|
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
$pasarParams .= '&query=' . uri_escape($query);
|
$pasarParams .= '&query=' . uri_escape_utf8($query);
|
||||||
$pasarParams .= '&count=' . uri_escape($results_per_page);
|
$pasarParams .= '&count=' . uri_escape_utf8($results_per_page);
|
||||||
$pasarParams .= '&simple_query=' . uri_escape($simple_query);
|
$pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query);
|
||||||
$pasarParams .= '&query_type=' . uri_escape($query_type) if ($query_type);
|
$pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type);
|
||||||
eval {
|
eval {
|
||||||
($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1);
|
($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1);
|
||||||
};
|
};
|
||||||
|
@ -699,12 +699,12 @@ for (my $i=0;$i<@servers;$i++) {
|
||||||
my $j = 0;
|
my $j = 0;
|
||||||
foreach (@newresults) {
|
foreach (@newresults) {
|
||||||
my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
|
my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
|
||||||
$pasarParams .= uri_escape($bibnum) . ',';
|
$pasarParams .= uri_escape_utf8($bibnum) . ',';
|
||||||
$j++;
|
$j++;
|
||||||
last if ($j == $results_per_page);
|
last if ($j == $results_per_page);
|
||||||
}
|
}
|
||||||
chop $pasarParams if ($pasarParams =~ /,$/);
|
chop $pasarParams if ($pasarParams =~ /,$/);
|
||||||
$pasarParams .= '&total=' . uri_escape( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/);
|
$pasarParams .= '&total=' . uri_escape_utf8( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/);
|
||||||
if ($pasarParams) {
|
if ($pasarParams) {
|
||||||
my $session = get_session($cgi->cookie("CGISESSID"));
|
my $session = get_session($cgi->cookie("CGISESSID"));
|
||||||
$session->param('busc' => $pasarParams);
|
$session->param('busc' => $pasarParams);
|
||||||
|
|
Loading…
Reference in a new issue