summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-01-14 13:01:27 +0000
committerNicholas Clark <nick@ccl4.org>2004-01-14 13:01:27 +0000
commitefc8e943aad385721753037c6be3d8bf9a5c28d8 (patch)
treedc0808379835c0f04aaa9a7c33317489b2fd62f8 /lib
parenta56b3a00287b552dbc3a1b6102629c6e0aedfc2d (diff)
downloadperl-efc8e943aad385721753037c6be3d8bf9a5c28d8.tar.gz
Assimilate CGI 3.03
p4raw-id: //depot/perl@22136
Diffstat (limited to 'lib')
-rw-r--r--lib/CGI.pm17
-rw-r--r--lib/CGI/Fast.pm2
-rw-r--r--lib/CGI/Util.pm2
3 files changed, 14 insertions, 7 deletions
diff --git a/lib/CGI.pm b/lib/CGI.pm
index 1fe49e3a00..68072f09da 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.145 2003/12/10 15:16:08 lstein Exp $';
-$CGI::VERSION=3.01;
+$CGI::revision = '$Id: CGI.pm,v 1.151 2004/01/13 16:28:35 lstein Exp $';
+$CGI::VERSION=3.03;
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
@@ -181,6 +181,7 @@ if (exists $ENV{MOD_PERL}) {
if (defined $mod_perl::VERSION) {
if ($mod_perl::VERSION >= 1.99) {
$MOD_PERL = 2;
+ require Apache::Response;
require Apache::RequestRec;
require Apache::RequestUtil;
require APR::Pool;
@@ -304,6 +305,10 @@ sub new {
)) {
$self->r(shift @initializer);
}
+ if (ref($initializer[0])
+ && (UNIVERSAL::isa($initializer[0],'CODE'))) {
+ $self->upload_hook(shift @initializer, shift @initializer);
+ }
if ($MOD_PERL) {
$self->r(Apache->request) unless $self->r;
my $r = $self->r;
@@ -1911,7 +1916,7 @@ sub submit {
$label=$self->escapeHTML($label);
$value=$self->escapeHTML($value,1);
- my($name) = ' name=".submit"' unless $NOSTICKY;
+ my $name = $NOSTICKY ? '' : ' name=".submit"';
$name = qq/ name="$label"/ if defined($label);
$value = defined($value) ? $value : $label;
my $val = '';
@@ -2126,6 +2131,8 @@ END_OF_FUNC
# unescape HTML -- used internally
'unescapeHTML' => <<'END_OF_FUNC',
sub unescapeHTML {
+ # hack to work around earlier hacks
+ push @_,$_[0] if @_==1 && $_[0] eq 'CGI';
my ($self,$string) = CGI::self_or_default(@_);
return undef unless defined($string);
my $latin = defined $self->{'.charset'} ? $self->{'.charset'} =~ /^(ISO-8859-1|WINDOWS-1252)$/i
@@ -2541,8 +2548,8 @@ sub url {
$script_name =~ s/\?.+$//; # strip query string
# and path
if (exists($ENV{PATH_INFO})) {
- my $encoded_path = quotemeta($ENV{PATH_INFO});
- $script_name =~ s/$encoded_path$//i;
+ my $encoded_path = unescape($ENV{PATH_INFO});
+ $script_name =~ s/\Q$encoded_path\E$//i;
}
}
diff --git a/lib/CGI/Fast.pm b/lib/CGI/Fast.pm
index 669b38e010..43b8709a16 100644
--- a/lib/CGI/Fast.pm
+++ b/lib/CGI/Fast.pm
@@ -16,7 +16,7 @@ package CGI::Fast;
# The most recent version and complete docs are available at:
# http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html
# ftp://ftp-genome.wi.mit.edu/pub/software/WWW/
-$CGI::Fast::VERSION='1.04';
+$CGI::Fast::VERSION='1.05';
use CGI;
use FCGI;
diff --git a/lib/CGI/Util.pm b/lib/CGI/Util.pm
index 7c7b08f1f0..be104facf9 100644
--- a/lib/CGI/Util.pm
+++ b/lib/CGI/Util.pm
@@ -7,7 +7,7 @@ require Exporter;
@EXPORT_OK = qw(rearrange make_attributes unescape escape
expires ebcdic2ascii ascii2ebcdic);
-$VERSION = '1.3';
+$VERSION = '1.4';
$EBCDIC = "\t" ne "\011";
if ($EBCDIC) {