summaryrefslogtreecommitdiffstats
path: root/Bugzilla/CGI.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-06-03 17:48:31 +0200
committerByron Jones <glob@mozilla.com>2015-06-03 17:48:31 +0200
commitbe2597572284cdef9bd58042754658f1f754d42a (patch)
tree3b26c33845572986966754b05a384e7c5ba3450d /Bugzilla/CGI.pm
parentf53e220cd53a5f6a85ac3bb53b321fa50ca7b4dd (diff)
downloadbugzilla-be2597572284cdef9bd58042754658f1f754d42a.tar.gz
bugzilla-be2597572284cdef9bd58042754658f1f754d42a.tar.xz
Bug 1170414: Redirection loop in *.cgi when path-info is present
Diffstat (limited to 'Bugzilla/CGI.pm')
-rw-r--r--Bugzilla/CGI.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 552da28ea..a5a1afc5c 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -77,11 +77,15 @@ sub new {
# Moreover, it causes unexpected behaviors, such as totally breaking
# the rendering of pages.
my $script = basename($0);
- if ($self->path_info) {
+ if (my $path = $self->path_info) {
my @whitelist = ("rest.cgi");
Bugzilla::Hook::process('path_info_whitelist', { whitelist => \@whitelist });
if (!grep($_ eq $script, @whitelist)) {
+ # apache collapses // to / in $ENV{PATH_INFO} but not in $self->path_info.
+ # url() requires the full path in ENV in order to generate the correct url.
+ $ENV{PATH_INFO} = $path;
print $self->redirect($self->url(-path => 0, -query => 1));
+ exit;
}
}