summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChip Salzenberg <chip@atlantic.net>1997-04-04 00:00:00 +0000
committerChip Salzenberg <chip@atlantic.net>1997-04-04 00:00:00 +0000
commit38b7982183d856ea25d377fcd59aae2da555ff5b (patch)
tree543cbefcda65d0639020f421766e50de0be3a382
parentdcb2879abe1a588042098f71cb130a72def08afb (diff)
downloadperl-38b7982183d856ea25d377fcd59aae2da555ff5b.tar.gz
CGI->redirect patch
(this is the same change as commit a3ec56f7f3704c7c711a382a2e558eb572cef265, but as applied)
-rw-r--r--lib/CGI.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CGI.pm b/lib/CGI.pm
index 4651e138a3..0c869d7262 100644
--- a/lib/CGI.pm
+++ b/lib/CGI.pm
@@ -29,7 +29,7 @@ $AUTOLOAD_DEBUG=0;
$NPH=0;
$CGI::revision = '$Id: CGI.pm,v 2.32 1997/3/19 10:10 lstein Exp $';
-$CGI::VERSION='2.3201';
+$CGI::VERSION='2.3202';
# OVERRIDE THE OS HERE IF CGI.pm GUESSES WRONG
# $OS = 'UNIX';
@@ -986,10 +986,18 @@ END_OF_FUNC
'redirect' => <<'END_OF_FUNC',
sub redirect {
my($self,@p) = self_or_default(@_);
- my($url,$target,$cookie,$nph,@other) = $self->rearrange([[URI,URL],TARGET,COOKIE,NPH],@p);
+ my($url,$target,$cookie,$nph,@other) =
+ $self->rearrange([[URI,URL],TARGET,COOKIE,NPH],@p);
$url = $url || $self->self_url;
my(@o);
foreach (@other) { push(@o,split("=")); }
+ if ($MOD_PERL or exists $self->{'.req'}) {
+ my $r = $self->{'.req'} || Apache->request;
+ $r->header_out(Location => $url);
+ $r->err_header_out(Location => $url);
+ $r->status(302);
+ return;
+ }
push(@o,
'-Status'=>'302 Found',
'-Location'=>$url,