Bugzilla – Attachment 100181 Details for
Bug 24719
C4::Context::set_remote_address() prevents file upload for non-Plack Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24719: [Alternate PATCH] Remove use of CGI object in C4::Context::set_remote_address()
Bug-24719-Alternate-PATCH-Remove-use-of-CGI-object.patch (text/plain), 1.51 KB, created by
Nick Clemens (kidclamp)
on 2020-03-05 12:19:21 UTC
(
hide
)
Description:
Bug 24719: [Alternate PATCH] Remove use of CGI object in C4::Context::set_remote_address()
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-03-05 12:19:21 UTC
Size:
1.51 KB
patch
obsolete
>From 3fbadc9b8ac834d042d4d55214accfb48947ab13 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 27 Feb 2020 00:28:48 +0000 >Subject: [PATCH] Bug 24719: [Alternate PATCH] Remove use of CGI object in > C4::Context::set_remote_address() > >This patch replaces the CGI "http" object method with its equivalent >class method, which doesn't require object instantiation and thus skips >global initialization and premature handling of the incoming HTTP request. > >Test plan: >0. Disable Plack if it is enabled >1. Set koha_trusted_proxies in koha-conf.xml to 1.1.1.1 >2. Clear Memcached >3. Try to upload MARCXML file to /cgi-bin/koha/tools/stage-marc-import.pl >4. Note that form below "Upload progress" never appears and errors show >in browser console >5. Apply the patch >6. Try to upload MARCXML file to /cgi-bin/koha/tools/stage-marc-import.pl >7. Note that form appears below "Upload progress" > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Context.pm | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 36d68b195c..7b10f8f1d0 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -1063,8 +1063,7 @@ variable to be set correctly. > sub set_remote_address { > if ( C4::Context->config('koha_trusted_proxies') ) { > require CGI; >- my $cgi = CGI->new; >- my $header = $cgi->http('HTTP_X_FORWARDED_FOR'); >+ my $header = CGI->http('HTTP_X_FORWARDED_FOR'); > > if ($header) { > require Koha::Middleware::RealIP; >-- >2.11.0
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 24719
:
99550
|
99594
|
99680
|
100095
|
100181
|
100211