Bugzilla – Attachment 26370 Details for
Bug 11944
Cleanup Koha UTF-8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11944: replace uri_escape with uri_escape_utf8 everywhere
Bug-11944-replace-uriescape-with-uriescapeutf8-eve.patch (text/plain), 10.61 KB, created by
Jonathan Druart
on 2014-03-14 19:20:28 UTC
(
hide
)
Description:
Bug 11944: replace uri_escape with uri_escape_utf8 everywhere
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-14 19:20:28 UTC
Size:
10.61 KB
patch
obsolete
>From 7e249269e4ee1e215a9731b27fa83562dcd688fd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 14 Mar 2014 16:07:11 +0100 >Subject: [PATCH] Bug 11944: replace uri_escape with uri_escape_utf8 > everywhere >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To reproduce, edit, index notice with صة and search "صة" >--- > C4/Auth.pm | 2 +- > C4/Search.pm | 22 +++++++++++----------- > authorities/authorities-home.pl | 2 +- > cataloguing/addbiblio.pl | 2 +- > cataloguing/additem.pl | 2 +- > members/pay.pl | 2 +- > reports/guided_reports.pl | 2 +- > reserve/renewscript.pl | 2 +- > serials/routing-preview.pl | 2 +- > serials/routing.pl | 2 +- > serials/subscription-frequency.pl | 2 +- > serials/subscription-numberpattern.pl | 2 +- > 12 files changed, 22 insertions(+), 22 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index d0bc7bc..af5a8bb 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1809,7 +1809,7 @@ sub SetSearchHistorySession { > return () unless $sessionID; > my $session = get_session($sessionID); > return () unless $session; >- $session->param('search_history', uri_escape(encode_json($search_history))); >+ $session->param('search_history', uri_escape_utf8(encode_json($search_history))); > } > > END { } # module clean-up code here (global destructor) >diff --git a/C4/Search.pm b/C4/Search.pm >index 56eca2f..c2e9d9a 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1306,17 +1306,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' ); > } >@@ -1488,9 +1488,9 @@ sub buildQuery { > $query .= " $operators[$i-1] "; > $query .= " $index_plus " unless $indexes_set; > $query .= " $operand"; >- $query_cgi .= "&op=".uri_escape($operators[$i-1]); >- $query_cgi .= "&idx=".uri_escape($index) if $index; >- $query_cgi .= "&q=".uri_escape($operands[$i]) if $operands[$i]; >+ $query_cgi .= "&op=".uri_escape_utf8($operators[$i-1]); >+ $query_cgi .= "&idx=".uri_escape_utf8($index) if $index; >+ $query_cgi .= "&q=".uri_escape_utf8($operands[$i]) if $operands[$i]; > $query_desc .= > " $operators[$i-1] $index_plus $operands[$i]"; > } >@@ -1500,8 +1500,8 @@ sub buildQuery { > $query .= " and "; > $query .= "$index_plus " unless $indexes_set; > $query .= "$operand"; >- $query_cgi .= "&op=and&idx=".uri_escape($index) if $index; >- $query_cgi .= "&q=".uri_escape($operands[$i]) if $operands[$i]; >+ $query_cgi .= "&op=and&idx=".uri_escape_utf8($index) if $index; >+ $query_cgi .= "&q=".uri_escape_utf8($operands[$i]) if $operands[$i]; > $query_desc .= " and $index_plus $operands[$i]"; > } > } >@@ -1513,8 +1513,8 @@ sub buildQuery { > $query .= " $index_plus " unless $indexes_set; > $query .= $operand; > $query_desc .= " $index_plus $operands[$i]"; >- $query_cgi .= "&idx=".uri_escape($index) if $index; >- $query_cgi .= "&q=".uri_escape($operands[$i]) if $operands[$i]; >+ $query_cgi .= "&idx=".uri_escape_utf8($index) if $index; >+ $query_cgi .= "&q=".uri_escape_utf8($operands[$i]) if $operands[$i]; > $previous_operand = 1; > } > } #/if $operands >diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl >index 3c9fefd..121adf0 100755 >--- a/authorities/authorities-home.pl >+++ b/authorities/authorities-home.pl >@@ -125,7 +125,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" >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index fa3e90b..de15c0b 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -886,7 +886,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 > ); >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 8dc5e30..9a57b4d 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -515,7 +515,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' > ); >diff --git a/members/pay.pl b/members/pay.pl >index 6665989..2fedfa3 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -171,7 +171,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); >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 4d41e1a..89b019b 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -743,7 +743,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, >diff --git a/reserve/renewscript.pl b/reserve/renewscript.pl >index 43e9082..7b93cd9 100755 >--- a/reserve/renewscript.pl >+++ b/reserve/renewscript.pl >@@ -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 >diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl >index 8b899cf..6d08bf2 100755 >--- a/serials/routing-preview.pl >+++ b/serials/routing-preview.pl >@@ -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, >diff --git a/serials/routing.pl b/serials/routing.pl >index 4232127..f508cf9 100755 >--- a/serials/routing.pl >+++ b/serials/routing.pl >@@ -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"); > } > >diff --git a/serials/subscription-frequency.pl b/serials/subscription-frequency.pl >index c32692a..6d3b7e1 100755 >--- a/serials/subscription-frequency.pl >+++ b/serials/subscription-frequency.pl >@@ -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)."}"; >diff --git a/serials/subscription-numberpattern.pl b/serials/subscription-numberpattern.pl >index b0b0ae1..cf0fdfa 100755 >--- a/serials/subscription-numberpattern.pl >+++ b/serials/subscription-numberpattern.pl >@@ -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),"}"; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11944
:
26364
|
26365
|
26366
|
26367
|
26368
|
26369
|
26370
|
26371
|
26372
|
26407
|
26408
|
26409
|
26737
|
26738
|
26739
|
26740
|
26741
|
26742
|
26743
|
26744
|
26745
|
26746
|
26747
|
26748
|
26794
|
26857
|
26858
|
26859
|
26860
|
26861
|
26862
|
26863
|
26864
|
26865
|
26866
|
26867
|
26868
|
26869
|
26870
|
26871
|
26895
|
26921
|
27021
|
27080
|
27094
|
27158
|
27159
|
27161
|
27193
|
27194
|
27195
|
27196
|
27198
|
27199
|
27200
|
27201
|
27202
|
27203
|
27204
|
27205
|
27206
|
27207
|
27208
|
27209
|
27210
|
27211
|
27212
|
27213
|
27214
|
27215
|
27216
|
27585
|
27586
|
27587
|
27588
|
27589
|
27590
|
27591
|
27592
|
27593
|
27594
|
27595
|
27596
|
27597
|
27598
|
27599
|
27600
|
27601
|
27602
|
27603
|
27880
|
27881
|
27882
|
27883
|
27884
|
27885
|
27886
|
27887
|
27888
|
27889
|
27890
|
27891
|
27892
|
27893
|
27894
|
27895
|
27896
|
27897
|
27898
|
28046
|
28047
|
28048
|
28049
|
28050
|
28051
|
28052
|
28053
|
28054
|
28055
|
28056
|
28057
|
28058
|
28059
|
28060
|
28061
|
28062
|
28063
|
28064
|
28065
|
28066
|
28097
|
28245
|
28246
|
28247
|
28248
|
28249
|
28250
|
28251
|
28252
|
28253
|
28732
|
29981
|
29982
|
29983
|
29984
|
29985
|
29986
|
29987
|
29988
|
29989
|
29990
|
29991
|
29992
|
29993
|
29994
|
29995
|
29996
|
29997
|
29998
|
29999
|
30000
|
30001
|
30002
|
30003
|
30004
|
30005
|
30006
|
30012
|
30016
|
30945
|
31299
|
35223
|
35224
|
35225
|
35226
|
35227
|
35228
|
35229
|
35230
|
35231
|
35232
|
35233
|
35234
|
35235
|
35236
|
35237
|
35238
|
35239
|
35240
|
35241
|
35242
|
35243
|
35244
|
35245
|
35246
|
35247
|
35248
|
35249
|
35250
|
35251
|
35252
|
35253