summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}
}