This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix to problem where CGI can lose the filehandle during an upload.
authorSteve Peters <steve@fisharerojo.org>
Thu, 17 Aug 2006 15:28:36 +0000 (15:28 +0000)
committerSteve Peters <steve@fisharerojo.org>
Thu, 17 Aug 2006 15:28:36 +0000 (15:28 +0000)
Patch posted to the Debian bug list by Eric Wong
<eric@petta-tech.com>.

p4raw-id: //depot/perl@28732

lib/CGI.pm

index 3547a78..15f1be5 100644 (file)
@@ -19,7 +19,7 @@ use Carp 'croak';
 #   http://stein.cshl.org/WWW/software/CGI/
 
 $CGI::revision = '$Id: CGI.pm,v 1.208 2006/04/23 14:25:14 lstein Exp $';
-$CGI::VERSION='3.20';
+$CGI::VERSION='3.20_01';
 
 # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
 # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
@@ -3416,7 +3416,7 @@ END_OF_FUNC
 'upload' =><<'END_OF_FUNC',
 sub upload {
     my($self,$param_name) = self_or_default(@_);
-    my @param = grep(ref && fileno($_), $self->param($param_name));
+    my @param = grep(ref && defined(fileno($_)), $self->param($param_name));
     return unless @param;
     return wantarray ? @param : $param[0];
 }