[bugzilla-gnome-org-customizations] don't redirect for splinter requests (bug 744232)
- From: Olav Vitters <ovitters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bugzilla-gnome-org-customizations] don't redirect for splinter requests (bug 744232)
- Date: Tue, 10 Feb 2015 13:52:01 +0000 (UTC)
commit c17544f4d021f2bef69c0bf66ffc3356484ba226
Author: Olav Vitters <olav vitters nl>
Date: Tue Feb 10 14:51:50 2015 +0100
don't redirect for splinter requests (bug 744232)
extensions/Splinter/lib/Ops.pm | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/extensions/Splinter/lib/Ops.pm b/extensions/Splinter/lib/Ops.pm
index 8332c85..4a597bf 100644
--- a/extensions/Splinter/lib/Ops.pm
+++ b/extensions/Splinter/lib/Ops.pm
@@ -181,4 +181,21 @@ sub add_dispatch {
$dispatches->{'Splinter'} = "Bugzilla::Extension::Splinter::WebService";
}
+sub splinter_use_attachbase {
+ my $cgi = Bugzilla->cgi;
+ my $attachbase = Bugzilla->params->{'attachment_base'};
+ my $urlbase = Bugzilla->params->{'urlbase'};
+ my $sslbase = Bugzilla->params->{'sslbase'};
+
+ my $splinter_regexp = $sslbase ? qr/^(\Q$urlbase\E|\Q$sslbase\E)review/ : qr/^\Q$urlbase\Ereview/;
+
+ return ($attachbase ne ''
+ && $attachbase ne $urlbase
+ && $attachbase ne $sslbase
+ && $cgi->referer !~ /$splinter_regexp/) ? 1 : 0;
+
+BEGIN {
+ *Bugzilla::Util::use_attachbase = \&splinter_use_attachbase;
+}
+
1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]