summaryrefslogtreecommitdiffstats
path: root/Bugzilla/CGI.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-08-15 23:46:13 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-08-15 23:46:13 +0200
commitba0b995c4453d3642e19343fa98f1b4034114f39 (patch)
tree4591772b7175810ed33fb1267ff393b771b59dd7 /Bugzilla/CGI.pm
parent5bcba2b42c531a50c0017a262e879b0b42940b53 (diff)
downloadbugzilla-ba0b995c4453d3642e19343fa98f1b4034114f39.tar.gz
bugzilla-ba0b995c4453d3642e19343fa98f1b4034114f39.tar.xz
Bug 779088 - Allow extensions to whitelist PATH_INFO
Diffstat (limited to 'Bugzilla/CGI.pm')
-rw-r--r--Bugzilla/CGI.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 9d8a1c48f..ce89a9e6d 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -73,11 +73,22 @@ sub new {
# Make sure our outgoing cookie list is empty on each invocation
$self->{Bugzilla_cookie_list} = [];
+ # Path-Info is of no use for Bugzilla and interacts badly with IIS.
+ # Moreover, it causes unexpected behaviors, such as totally breaking
+ # the rendering of pages.
+ my $script = basename($0);
+ if ($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));
+ }
+ }
+
# Send appropriate charset
$self->charset(Bugzilla->params->{'utf8'} ? 'UTF-8' : '');
# Redirect to urlbase/sslbase if we are not viewing an attachment.
- my $script = basename($0);
if ($self->url_is_attachment_base and $script ne 'attachment.cgi') {
$self->redirect_to_urlbase();
}