Bug 11944: replace uri_escape with uri_escape_utf8 everywhere
To reproduce, edit, index notice with utf-8 char and search for it Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
a82d7144bf
commit
3d59fc384d
18
C4/Search.pm
18
C4/Search.pm
|
|
@ -1479,17 +1479,17 @@ sub buildQuery {
|
|||
if ( @limits ) {
|
||||
$q .= ' and '.join(' and ', @limits);
|
||||
}
|
||||
return ( undef, $q, $q, "q=ccl=".uri_escape($q), $q, '', '', '', '', 'ccl' );
|
||||
return ( undef, $q, $q, "q=ccl=".uri_escape_utf8($q), $q, '', '', '', '', 'ccl' );
|
||||
}
|
||||
if ( $query =~ /^cql=/ ) {
|
||||
return ( undef, $', $', "q=cql=".uri_escape($'), $', '', '', '', '', 'cql' );
|
||||
return ( undef, $', $', "q=cql=".uri_escape_utf8($'), $', '', '', '', '', 'cql' );
|
||||
}
|
||||
if ( $query =~ /^pqf=/ ) {
|
||||
if ($query_desc) {
|
||||
$query_cgi = "q=".uri_escape($query_desc);
|
||||
$query_cgi = "q=".uri_escape_utf8($query_desc);
|
||||
} else {
|
||||
$query_desc = $';
|
||||
$query_cgi = "q=pqf=".uri_escape($');
|
||||
$query_cgi = "q=pqf=".uri_escape_utf8($');
|
||||
}
|
||||
return ( undef, $', $', $query_cgi, $query_desc, '', '', '', '', 'pqf' );
|
||||
}
|
||||
|
|
@ -1711,7 +1711,7 @@ sub buildQuery {
|
|||
$group_OR_limits{$k} .= " or " if $group_OR_limits{$k};
|
||||
$limit_desc .= " or " if $group_OR_limits{$k};
|
||||
$group_OR_limits{$k} .= "$this_limit";
|
||||
$limit_cgi .= "&limit=" . uri_escape($this_limit);
|
||||
$limit_cgi .= "&limit=" . uri_escape_utf8($this_limit);
|
||||
$limit_desc .= " $this_limit";
|
||||
}
|
||||
|
||||
|
|
@ -1719,7 +1719,7 @@ sub buildQuery {
|
|||
else {
|
||||
$limit .= " and " if $limit || $query;
|
||||
$limit .= "$this_limit";
|
||||
$limit_cgi .= "&limit=" . uri_escape($this_limit);
|
||||
$limit_cgi .= "&limit=" . uri_escape_utf8($this_limit);
|
||||
if ($this_limit =~ /^branch:(.+)/) {
|
||||
my $branchcode = $1;
|
||||
my $branchname = GetBranchName($branchcode);
|
||||
|
|
@ -1809,9 +1809,9 @@ sub _build_initial_query {
|
|||
#e.g. " and kw,wrdl:test"
|
||||
$params->{query} .= $operator . $operand;
|
||||
|
||||
$params->{query_cgi} .= "&op=".uri_escape($operator) if $operator;
|
||||
$params->{query_cgi} .= "&idx=".uri_escape($params->{index}) if $params->{index};
|
||||
$params->{query_cgi} .= "&q=".uri_escape($params->{original_operand}) if $params->{original_operand};
|
||||
$params->{query_cgi} .= "&op=".uri_escape_utf8($operator) if $operator;
|
||||
$params->{query_cgi} .= "&idx=".uri_escape_utf8($params->{index}) if $params->{index};
|
||||
$params->{query_cgi} .= "&q=".uri_escape_utf8($params->{original_operand}) if $params->{original_operand};
|
||||
|
||||
#e.g. " and kw,wrdl: test"
|
||||
$params->{query_desc} .= $operator . $params->{index_plus} . " " . $params->{original_operand};
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ sub set_to_session {
|
|||
my $session = C4::Auth::get_session($sessionID);
|
||||
return () unless $session;
|
||||
$session->param( 'search_history',
|
||||
uri_escape( encode_json($search_history) ) );
|
||||
uri_escape_utf8( encode_json($search_history) ) );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ if ( $op eq "do_search" ) {
|
|||
# next/previous would not work anymore
|
||||
|
||||
# construction of the url of each page
|
||||
my $value_url = uri_escape($value);
|
||||
my $value_url = uri_escape_utf8($value);
|
||||
my $base_url = "authorities-home.pl?"
|
||||
."marclist=$marclist"
|
||||
."&and_or=$and_or"
|
||||
|
|
|
|||
|
|
@ -874,7 +874,7 @@ if ( $op eq "addbiblio" ) {
|
|||
.'&frameworkcode='.$frameworkcode
|
||||
.'&circborrowernumber='.$fa_circborrowernumber
|
||||
.'&branch='.$fa_branch
|
||||
.'&barcode='.uri_escape($fa_barcode)
|
||||
.'&barcode='.uri_escape_utf8($fa_barcode)
|
||||
.'&stickyduedate='.$fa_stickyduedate
|
||||
.'&duedatespec='.$fa_duedatespec
|
||||
);
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ if ($op eq "additem") {
|
|||
print $input->redirect(
|
||||
'/cgi-bin/koha/circ/circulation.pl?'
|
||||
.'borrowernumber='.$fa_circborrowernumber
|
||||
.'&barcode='.uri_escape($fa_barcode)
|
||||
.'&barcode='.uri_escape_utf8($fa_barcode)
|
||||
.'&duedatespec='.$fa_duedatespec
|
||||
.'&stickyduedate=1'
|
||||
);
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ sub redirect_to_paycollect {
|
|||
$redirect .= get_for_redirect( 'notify_id', "notify_id$line_no", 0 );
|
||||
$redirect .= get_for_redirect( 'notify_level', "notify_level$line_no", 0 );
|
||||
$redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
|
||||
$redirect .= q{&} . 'payment_note' . q{=} . uri_escape( $input->param("payment_note_$line_no") );
|
||||
$redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( $input->param("payment_note_$line_no") );
|
||||
$redirect .= '&remote_user=';
|
||||
$redirect .= $user;
|
||||
return print $input->redirect($redirect);
|
||||
|
|
|
|||
|
|
@ -754,7 +754,7 @@ elsif ($phase eq 'Run this report'){
|
|||
my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0);
|
||||
my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report&limit=$limit";
|
||||
if (@sql_params) {
|
||||
$url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params);
|
||||
$url = join('&sql_params=', $url, map { URI::Escape::uri_escape_utf8($_) } @sql_params);
|
||||
}
|
||||
$template->param(
|
||||
'results' => \@rows,
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ foreach my $barcode (@barcodes) {
|
|||
# redirection to the referrer page
|
||||
#
|
||||
if ( $input->param('destination') eq "circ" ) {
|
||||
$cardnumber = uri_escape($cardnumber);
|
||||
$cardnumber = uri_escape_utf8($cardnumber);
|
||||
print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?findborrower='
|
||||
. $cardnumber
|
||||
. $failedrenews
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ $routingnotes =~ s/\n/\<br \/\>/g;
|
|||
$template->param(
|
||||
title => $subs->{'bibliotitle'},
|
||||
issue => $issue,
|
||||
issue_escaped => URI::Escape::uri_escape($issue),
|
||||
issue_escaped => URI::Escape::uri_escape_utf8($issue),
|
||||
subscriptionid => $subscriptionid,
|
||||
memberloop => $memberloop,
|
||||
routingnotes => $routingnotes,
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ if($op eq 'add'){
|
|||
if($op eq 'save'){
|
||||
my $sth = $dbh->prepare('UPDATE serial SET routingnotes = ? WHERE subscriptionid = ?');
|
||||
$sth->execute($notes,$subscriptionid);
|
||||
my $urldate = URI::Escape::uri_escape($date_selected);
|
||||
my $urldate = URI::Escape::uri_escape_utf8($date_selected);
|
||||
print $query->redirect("routing-preview.pl?subscriptionid=$subscriptionid&issue=$urldate");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,4 +33,4 @@ if ($auth_status ne "ok") {
|
|||
my $frequencyrecord=GetSubscriptionFrequency($frqid);
|
||||
binmode STDOUT, ":encoding(UTF-8)";
|
||||
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
|
||||
print "{".join (",",map { "\"$_\":\"".uri_escape($frequencyrecord->{$_})."\"" }sort keys %$frequencyrecord)."}";
|
||||
print "{".join (",",map { "\"$_\":\"".uri_escape_utf8($frequencyrecord->{$_})."\"" }sort keys %$frequencyrecord)."}";
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@ my $numpatternid=$input->param("numberpattern_id");
|
|||
my $numberpatternrecord=GetSubscriptionNumberpattern($numpatternid);
|
||||
binmode STDOUT, ":encoding(UTF-8)";
|
||||
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
|
||||
print "{",join (",",map {"\"$_\":\"".(uri_escape($numberpatternrecord->{$_}) // '')."\"" }sort keys %$numberpatternrecord),"}";
|
||||
print "{",join (",",map {"\"$_\":\"".(uri_escape_utf8($numberpatternrecord->{$_}) // '')."\"" }sort keys %$numberpatternrecord),"}";
|
||||
|
|
|
|||
Loading…
Reference in New Issue