r41067 - in /branches/upstream/libcgi-pm-perl/current: CGI.pm Changes META.yml
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Fri Jul 31 10:16:38 UTC 2009
Author: ansgar-guest
Date: Fri Jul 31 10:16:22 2009
New Revision: 41067
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41067
Log:
[svn-upgrade] Integrating new upstream version, libcgi-pm-perl (3.44)
Modified:
branches/upstream/libcgi-pm-perl/current/CGI.pm
branches/upstream/libcgi-pm-perl/current/Changes
branches/upstream/libcgi-pm-perl/current/META.yml
Modified: branches/upstream/libcgi-pm-perl/current/CGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcgi-pm-perl/current/CGI.pm?rev=41067&op=diff
==============================================================================
--- branches/upstream/libcgi-pm-perl/current/CGI.pm (original)
+++ branches/upstream/libcgi-pm-perl/current/CGI.pm Fri Jul 31 10:16:22 2009
@@ -18,8 +18,8 @@
# 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.44';
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
@@ -644,8 +644,17 @@
}
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 +662,8 @@
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 +683,10 @@
&& 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 +1007,47 @@
}
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.
@@ -1129,6 +1180,12 @@
'MethPost' => <<'END_OF_FUNC',
sub MethPost {
return request_method() eq 'POST';
+}
+END_OF_FUNC
+
+'MethPut' => <<'END_OF_FUNC',
+sub MethPut {
+ return request_method() eq 'PUT';
}
END_OF_FUNC
@@ -2779,9 +2836,8 @@
# value of the cookie, if any. For efficiency, we cache the parsed
# cookies in our state variables.
unless ( defined($value) ) {
- $self->{'.cookies'} = CGI::Cookie->fetch
- unless $self->{'.cookies'};
-
+ $self->{'.cookies'} = CGI::Cookie->fetch;
+
# If no name is supplied, then retrieve the names of all our cookies.
return () unless $self->{'.cookies'};
return keys %{$self->{'.cookies'}} unless $name;
@@ -3185,8 +3241,12 @@
'http' => <<'END_OF_FUNC',
sub http {
my ($self,$parameter) = self_or_CGI(@_);
- return $ENV{$parameter} if $parameter=~/^HTTP/;
- $parameter =~ tr/-/_/;
+ if ( defined($parameter) ) {
+ if ( $parameter =~ /^HTTP/ ) {
+ return $ENV{$parameter};
+ }
+ $parameter =~ tr/-/_/;
+ }
return $ENV{"HTTP_\U$parameter\E"} if $parameter;
my(@p);
for (keys %ENV) {
@@ -3426,7 +3486,7 @@
$header{'Content-Disposition'} ||= ''; # quench uninit variable warning
- my($param)= $header{'Content-Disposition'}=~/ name="([^"]*)"/;
+ my($param)= $header{'Content-Disposition'}=~/[\s;]name="([^"]*)"/;
$param .= $TAINTED;
# See RFC 1867, 2183, 2045
Modified: branches/upstream/libcgi-pm-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcgi-pm-perl/current/Changes?rev=41067&op=diff
==============================================================================
--- branches/upstream/libcgi-pm-perl/current/Changes (original)
+++ branches/upstream/libcgi-pm-perl/current/Changes Fri Jul 31 10:16:22 2009
@@ -1,3 +1,9 @@
+ Version 3.44
+ 1. Patch from Kurt Jaeger to allow HTTP PUT even if the content length is unknown.
+ 2. Patch from Pavel merdin to fix a problem for one of the FireFox addons.
+ 3. Fixed issue in mod_perl & fastCGI environment of cookies returned from
+ CGI->cookie() leaking from one session to another.
+
Version 3.43
1. Documentation patch from MARKSTOS at cpan.org to replace all occurrences of
"new CGI" with CGI->new()" to reflect best perl practices.
Modified: branches/upstream/libcgi-pm-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcgi-pm-perl/current/META.yml?rev=41067&op=diff
==============================================================================
--- branches/upstream/libcgi-pm-perl/current/META.yml (original)
+++ branches/upstream/libcgi-pm-perl/current/META.yml Fri Jul 31 10:16:22 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: CGI.pm
-version: 3.43
+version: 3.44
abstract: ~
license: ~
author: ~
More information about the Pkg-perl-cvs-commits
mailing list