Bugzilla – Attachment 99594 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: Remove use of CGI in C4::Context::set_remote_address()
Bug-24719-Remove-use-of-CGI-in-C4Contextsetremotea.patch (text/plain), 1.38 KB, created by
Martin Renvoize (ashimema)
on 2020-02-25 16:38:42 UTC
(
hide
)
Description:
Bug 24719: Remove use of CGI in C4::Context::set_remote_address()
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-25 16:38:42 UTC
Size:
1.38 KB
patch
obsolete
>From ef7f056a7420d2c86cc93ab4a72dab826e2db57e 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] Bug 24719: 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" > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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.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 24719
:
99550
|
99594
|
99680
|
100095
|
100181
|
100211