Commit ca3d5907 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 783386: Removing PATH_INFO prevents Bugzilla from working correctly with IIS

r=dkl a=LpSolit
parent 366be504
......@@ -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));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment