Browse Source

temp bugfix -- restore file upload functionality

CGI->new() should not be used in any C4 module -
it has a side-effect that breaks the AJAX
file upload script.  Specifically, any file upload
field is slurped when a new CGI object is created, and
is not available to a second object created by CGI->new().

Consequently, C4::Debug should not be instantiating
a CGI object in its BEGIN block.  It can use other CGI::* modules
to parse QUERY_STRING to get the value of the debug
parameter (note that this means that the debug param
can be reliably set only in a GET, not as part of a
form submission).

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Galen Charlton 17 years ago
committed by Joshua Ferraro
parent
commit
6eba80e5f5
  1. 5
      C4/Debug.pm

5
C4/Debug.pm

@ -37,9 +37,10 @@ BEGIN {
BEGIN {
# this stuff needs a begin block too, since dependencies might alter their compilations
# for example, adding DataDumper
my $query = CGI->new();
#my $query = CGI->new();
$debug = $ENV{KOHA_DEBUG} || $ENV{DEBUG} || 0;
$cgi_debug = $ENV{KOHA_CGI_DEBUG} || $query->param('debug') || 0;
#$cgi_debug = $ENV{KOHA_CGI_DEBUG} || $query->param('debug') || 0;
$cgi_debug = $ENV{KOHA_CGI_DEBUG} || 0;
unless (0 <= $debug and $debug <= 9) {
warn "Invalid \$debug value attempted: $debug";
$debug=1;

Loading…
Cancel
Save