From: David Mitchell Date: Sat, 22 Aug 2009 17:02:13 +0000 (+0100) Subject: upgrade GCI from 3.43 to 3.45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68a4c8b9f23d187f9b39cb387da580869f4cd8ee;p=p5sagit%2Fp5-mst-13.2.git upgrade GCI from 3.43 to 3.45 Note that this blows away some local mods: * b<> to B<> fixes * core boilerplate for upload.t and uploadInfo.t --- diff --git a/MANIFEST b/MANIFEST index a5daf74..b70837d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1926,21 +1926,26 @@ lib/CGI/t/apache.t See if CGI::Apache still loads lib/CGI/t/can.t See if CGI.pm works lib/CGI/t/carp.t See if CGI::Carp works lib/CGI/t/cookie.t See if CGI::Cookie works +lib/CGI/t/Dump.t See if CGI->Dump works lib/CGI/t/fast.t See if CGI::Fast works (if FCGI is installed) lib/CGI/t/form.t See if CGI.pm works lib/CGI/t/function.t See if CGI.pm works lib/CGI/t/html.t See if CGI.pm works lib/CGI/t/no_tabindex.t See if CGI.pm works +lib/CGI/t/popup_menu.t See if CGI pop menus work lib/CGI/t/pretty.t See if CGI.pm works lib/CGI/t/push.t See if CGI::Push works +lib/CGI/t/query_string.t See if CGI->query_string() works lib/CGI/t/request.t See if CGI.pm works lib/CGI/t/start_end_asterisk.t See if CGI.pm works lib/CGI/t/start_end_end.t See if CGI.pm works lib/CGI/t/start_end_start.t See if CGI.pm works lib/CGI/t/switch.t See if CGI::Switch still loads +lib/CGI/t/unescapeHTML.t See if CGI::unescapeHTML() works lib/CGI/t/uploadInfo.t See if CGI.pm works lib/CGI/t/upload_post_text.txt.packed Test data for CGI.pm lib/CGI/t/upload.t See if CGI.pm works +lib/CGI/t/user_agent.t See if CGI->user_agent() works lib/CGI/t/util-58.t See if 5.8-dependent features work lib/CGI/t/util.t See if CGI.pm works lib/CGI/Util.pm Utility functions diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 0851f82..9d7365e 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -314,7 +314,7 @@ package Maintainers; 'CGI' => { 'MAINTAINER' => 'lstein', - 'DISTRIBUTION' => 'LDS/CGI.pm-3.43.tar.gz', + 'DISTRIBUTION' => 'LDS/CGI.pm-3.45.tar.gz', 'FILES' => q[lib/CGI.pm lib/CGI], 'EXCLUDED' => [ qr{^t/lib/Test}, qw( cgi-lib_porting.html @@ -324,8 +324,7 @@ package Maintainers; ) ], 'MAP' => { 'examples/' => 'lib/CGI/eg/', - 'CGI/' => 'lib/CGI/', - 'CGI.pm' => 'lib/CGI.pm', + 'lib/' => 'lib/', '' => 'lib/CGI/', }, 'CPAN' => 1, diff --git a/lib/CGI.pm b/lib/CGI.pm index 008bc7b..cacb03a 100644 --- a/lib/CGI.pm +++ b/lib/CGI.pm @@ -18,8 +18,8 @@ use Carp 'croak'; # The most recent version and complete docs are available at: # http://stein.cshl.org/WWW/software/CGI/ -$CGI::revision = '$Id: CGI.pm,v 1.263 2009/02/11 16:56:37 lstein Exp $'; -$CGI::VERSION='3.43'; +$CGI::revision = '$Id: CGI.pm,v 1.266 2009/07/30 16:32:34 lstein Exp $'; +$CGI::VERSION='3.45'; # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. @@ -61,8 +61,8 @@ sub initialize_globals { # Set this to 1 to enable NOSTICKY scripts # or: - # 1) use CGI qw(-nosticky) - # 2) $CGI::nosticky(1) + # 1) use CGI '-nosticky'; + # 2) $CGI::NOSTICKY = 1; $NOSTICKY = 0; # Set this to 1 to enable NPH scripts @@ -156,12 +156,14 @@ if ($OS =~ /^MSWin/i) { $OS = 'EPOC'; } elsif ($OS =~ /^cygwin/i) { $OS = 'CYGWIN'; +} elsif ($OS =~ /^NetWare/i) { + $OS = 'NETWARE'; } else { $OS = 'UNIX'; } # Some OS logic. Binary mode enabled on DOS, NT and VMS -$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN)/; +$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN|NETWARE)/; # This is the default class for the CGI object to use when all else fails. $DefaultClass = 'CGI' unless defined $CGI::DefaultClass; @@ -172,7 +174,7 @@ $AutoloadClass = $DefaultClass unless defined $CGI::AutoloadClass; # The path separator is a slash, backslash or semicolon, depending # on the paltform. $SL = { - UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/', + UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/', NETWARE => '/', WINDOWS => '\\', DOS => '\\', MACINTOSH => ':', VMS => '/' }->{$OS}; @@ -181,8 +183,12 @@ $SL = { # $NPH++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; $IIS++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; +# Turn on special checking for ActiveState's PerlEx +$PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; + # Turn on special checking for Doug MacEachern's modperl -if (exists $ENV{MOD_PERL}) { +# PerlEx::DBI tries to fool DBI by setting MOD_PERL +if (exists $ENV{MOD_PERL} && ! $PERLEX) { # mod_perl handlers may run system() on scripts using CGI.pm; # Make sure so we don't get fooled by inherited $ENV{MOD_PERL} if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) { @@ -198,9 +204,6 @@ if (exists $ENV{MOD_PERL}) { } } -# Turn on special checking for ActiveState's PerlEx -$PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; - # Define the CRLF sequence. I can't use a simple "\r\n" because the meaning # of "\n" is different on different OS's (sometimes it generates CRLF, sometimes LF # and sometimes CR). The most popular VMS web server @@ -644,8 +647,17 @@ sub init { } if ($meth eq 'POST' || $meth eq 'PUT') { - $self->read_from_client(\$query_string,$content_length,0) - if $content_length > 0; + if ( $content_length > 0 ) { + $self->read_from_client(\$query_string,$content_length,0); + } + else { + $self->read_from_stdin(\$query_string); + # should this be PUTDATA in case of PUT ? + my($param) = $meth . 'DATA' ; + $self->add_parameter($param) ; + push (@{$self->{param}{$param}},$query_string); + undef $query_string ; + } # Some people want to have their cake and eat it too! # Uncomment this line to have the contents of the query string # APPENDED to the POST data. @@ -653,7 +665,8 @@ sub init { last METHOD; } - # If $meth is not of GET, POST or HEAD, assume we're being debugged offline. + # If $meth is not of GET, POST, PUT or HEAD, assume we're + # being debugged offline. # Check the command line and then the standard input for data. # We use the shellwords package in order to behave the way that # UN*X programmers expect. @@ -673,10 +686,10 @@ sub init { && defined($ENV{'CONTENT_TYPE'}) && $ENV{'CONTENT_TYPE'} !~ m|^application/x-www-form-urlencoded| && $ENV{'CONTENT_TYPE'} !~ m|^multipart/form-data| ) { - my($param) = $meth . 'DATA' ; - $self->add_parameter($param) ; - push (@{$self->{param}{$param}},$query_string); - undef $query_string ; + my($param) = $meth . 'DATA' ; + $self->add_parameter($param) ; + push (@{$self->{param}{$param}},$query_string); + undef $query_string ; } # YL: End Change for XML handler 10/19/2001 @@ -997,6 +1010,47 @@ sub read_from_client { } END_OF_FUNC +'read_from_stdin' => <<'END_OF_FUNC', +# Read data from stdin until all is read +sub read_from_stdin { + my($self, $buff) = @_; + local $^W=0; # prevent a warning + + # + # TODO: loop over STDIN until all is read + # + + my($eoffound) = 0; + my($localbuf) = ''; + my($tempbuf) = ''; + my($bufsiz) = 1024; + my($res); + while ($eoffound == 0) { + if ( $MOD_PERL ) { + $res = $self->r->read($tempbuf, $bufsiz, 0) + } + else { + $res = read(\*STDIN, $tempbuf, $bufsiz); + } + + if ( !defined($res) ) { + # TODO: how to do error reporting ? + $eoffound = 1; + last; + } + if ( $res == 0 ) { + $eoffound = 1; + last; + } + $localbuf .= $tempbuf; + } + + $$buff = $localbuf; + + return $res; +} +END_OF_FUNC + 'delete' => <<'END_OF_FUNC', #### Method: delete # Deletes the named parameter entirely. @@ -1132,6 +1186,12 @@ sub MethPost { } END_OF_FUNC +'MethPut' => <<'END_OF_FUNC', +sub MethPut { + return request_method() eq 'PUT'; +} +END_OF_FUNC + 'TIEHASH' => <<'END_OF_FUNC', sub TIEHASH { my $class = shift; @@ -1300,7 +1360,7 @@ sub Dump { push(@result,"