summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-08-17 17:12:06 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-08-17 17:12:06 +0200
commitca3d59070b8e470c3c82399f62e8b801db043e89 (patch)
tree32c4e8e8fd6e11cfe3e00a9611b3d73066d5826a
parent366be5044d13da8e493a3a1e3d7153a18470c170 (diff)
downloadbugzilla-ca3d59070b8e470c3c82399f62e8b801db043e89.tar.gz
bugzilla-ca3d59070b8e470c3c82399f62e8b801db043e89.tar.xz
Bug 783386: Removing PATH_INFO prevents Bugzilla from working correctly with IIS
r=dkl a=LpSolit
-rw-r--r--Bugzilla/CGI.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 09907fb55..ed8540b2a 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -61,11 +61,18 @@ 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_info = $self->path_info) {
my @whitelist;
Bugzilla::Hook::process('path_info_whitelist', { whitelist => \@whitelist });
if (!grep($_ eq $script, @whitelist)) {
- print $self->redirect($self->url(-path => 0, -query => 1));
+ # IIS includes the full path to the script in PATH_INFO,
+ # so we have to extract the real PATH_INFO from it,
+ # else we will be redirected outside Bugzilla.
+ my $script_name = $self->script_name;
+ $path_info =~ s/^\Q$script_name\E//;
+ if ($path_info) {
+ print $self->redirect($self->url(-path => 0, -query => 1));
+ }
}
}