Bugzilla – Attachment 36763 Details for
Bug 13815
plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Bug-13815---plack-loose-CGI-qw-utf8-flag-creating-.patch (text/plain), 1.35 KB, created by
Dobrica Pavlinusic
on 2015-03-10 12:37:19 UTC
(
hide
)
Description:
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2015-03-10 12:37:19 UTC
Size:
1.35 KB
patch
obsolete
>From aa9a8ebf521eb6eb1099d24ddfee5158f6ae4d2f Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Tue, 10 Mar 2015 13:35:03 +0100 >Subject: [PATCH] Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere > >This is major problem for plack installations with utf-8 encoding. > >In this case, we are overriding CGI->new to setup utf-8 flag and >get correctly decoded $cgi->params, and reset syspref cache using >C4::Context->clear_syspref_cache > >Test scenario: >1. under plack try to search with utf-8 charactes >2. try to find patron with utf-8 characters >--- > misc/plack/koha.psgi | 15 +++++++++++++++ > 1 files changed, 15 insertions(+), 0 deletions(-) > >diff --git a/misc/plack/koha.psgi b/misc/plack/koha.psgi >index 7acb567..20ea61f 100644 >--- a/misc/plack/koha.psgi >+++ b/misc/plack/koha.psgi >@@ -5,6 +5,21 @@ use lib qw( ./lib ); > use Plack::Middleware::Debug; > use Plack::App::Directory; > >+use CGI qw(-utf8 ); # we will loose -utf8 under plack >+{ >+ my $old_new = \&CGI::new; >+ *CGI::new = sub { >+ warn "# override CGI->new\n"; >+ my $q = $old_new->( @_ ); >+ if ( ! $CGI::PARAM_UTF8 ) { >+ warn "# CGI->new -utf8 = ",$CGI::PARAM_UTF8; >+ $CGI::PARAM_UTF8 = 1; >+ } >+ C4::Context->clear_syspref_cache(); >+ return $q; >+ }; >+} >+ > BEGIN { > > # override configuration from startup script below: >-- >1.7.2.5
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 13815
:
36763
|
36944
|
38162
|
39865