Bugzilla – Attachment 111282 Details for
Bug 20582
Turn Koha into a Mojolicious application
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20582: Reset CGI::PARAM_UTF8 to 1 before each CGI request
Bug-20582-Reset-CGIPARAMUTF8-to-1-before-each-CGI-.patch (text/plain), 1.33 KB, created by
Julian Maurice
on 2020-10-06 11:23:23 UTC
(
hide
)
Description:
Bug 20582: Reset CGI::PARAM_UTF8 to 1 before each CGI request
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2020-10-06 11:23:23 UTC
Size:
1.33 KB
patch
obsolete
>From 57c0a9eb17d89de735836739e5e8f7c69505d21e Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 6 Oct 2020 13:21:29 +0200 >Subject: [PATCH] Bug 20582: Reset CGI::PARAM_UTF8 to 1 before each CGI request > >CGI::Compile calls CGI::initialize_globals before each request, which >resets PARAM_UTF8 to 0 >We need to set it back to the correct value > >This is the same trick used in debian/templates/plack.psgi >--- > Koha/App/Plugin/CGIBinKoha.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/Koha/App/Plugin/CGIBinKoha.pm b/Koha/App/Plugin/CGIBinKoha.pm >index 6c07743630..b7b8d4680b 100644 >--- a/Koha/App/Plugin/CGIBinKoha.pm >+++ b/Koha/App/Plugin/CGIBinKoha.pm >@@ -21,6 +21,7 @@ use Modern::Perl; > > use Mojo::Base 'Mojolicious::Plugin'; > >+use CGI; > use CGI::Compile; > use CGI::Emulate::PSGI; > use IO::Scalar; >@@ -28,6 +29,17 @@ use IO::Scalar; > sub register { > my ($self, $app, $conf) = @_; > >+ # CGI::Compile calls CGI::initialize_globals before each request, which resets PARAM_UTF8 to 0 >+ # We need to set it back to the correct value >+ { >+ no warnings 'redefine'; >+ my $old_new = \&CGI::new; >+ *CGI::new = sub { >+ $CGI::PARAM_UTF8 = 1; >+ return $old_new->(@_); >+ }; >+ } >+ > my $opac = $conf->{opac}; > > my $r = $app->routes; >-- >2.20.1
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 20582
:
74173
|
74517
|
74518
|
74519
|
74520
|
79648
|
81687
|
81857
|
82423
|
84526
|
84527
|
84528
|
84529
|
84530
|
84531
|
91009
|
99267
|
103633
|
103720
|
103721
|
109282
|
109283
|
109284
|
109895
|
109896
|
109897
|
109898
|
109899
|
109900
| 111282 |
111315
|
111374