Bugzilla – Attachment 99550 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]
Remove use of CGI in C4::Context::set_remote_address()
Remove-use-of-CGI-in-C4Contextsetremoteaddress.patch (text/plain), 1.36 KB, created by
David Cook
on 2020-02-25 02:34:02 UTC
(
hide
)
Description:
Remove use of CGI in C4::Context::set_remote_address()
Filename:
MIME Type:
Creator:
David Cook
Created:
2020-02-25 02:34:02 UTC
Size:
1.36 KB
patch
obsolete
>From ac99e6bd729ede8ee431ca21d7c4784ea5b46220 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 25 Feb 2020 13:28:05 +1100 >Subject: [PATCH] Remove use of CGI in C4::Context::set_remote_address() > >This patch removes the CGI module usage, as it was causing file upload >problems for scripts like /cgi-bin/koha/tools/stage-marc-import.pl > >Test plan: >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" > >https://bugs.koha-community.org/show_bug.cgi?id=24719 >--- > C4/Context.pm | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 0fe571da2a..a846706d9c 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -1109,9 +1109,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 = $ENV{'HTTP_X_FORWARDED_FOR'}; > > if ($header) { > require Koha::Middleware::RealIP; >-- >2.16.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 24719
:
99550
|
99594
|
99680
|
100095
|
100181
|
100211