summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-09-17 23:51:18 +0200
committerDylan William Hardison <dylan@hardison.net>2018-09-17 23:51:18 +0200
commit8c35832dd5d1de52b3dd5b4843be627b826a570d (patch)
tree946d8d331c6d8a40a9737e0bbf175729afa637ad
parent078cd25cf89223457f6d79040dc701f179887b30 (diff)
downloadbugzilla-8c35832dd5d1de52b3dd5b4843be627b826a570d.tar.gz
bugzilla-8c35832dd5d1de52b3dd5b4843be627b826a570d.tar.xz
Bug 1490901 - ReviewBoard stub attachments no longer make a redirect, download a text file instead
-rw-r--r--extensions/BMO/lib/Data.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/extensions/BMO/lib/Data.pm b/extensions/BMO/lib/Data.pm
index ed576f1a5..349f88093 100644
--- a/extensions/BMO/lib/Data.pm
+++ b/extensions/BMO/lib/Data.pm
@@ -27,6 +27,21 @@ our @EXPORT = qw( $cf_visible_in_products
# will result in the user being redirected to that URL when viewing the
# attachment.
+my $mozreview_url_re = qr{
+ # begins with mozreview hostname
+ ^
+ https?://reviewboard(?:-dev)?\.(?:allizom|mozilla)\.org
+
+ # followed by a review path
+ /r/\d+
+
+ # ends with optional suffix
+ (?: /
+ | /diff/\#index_header
+ )?
+ $
+}ix;
+
sub phabricator_url_re {
my $phab_uri = Bugzilla->params->{phabricator_base_uri} || 'https://example.com';
return qr/^\Q${phab_uri}\ED\d+$/i;
@@ -39,6 +54,12 @@ our %autodetect_attach_urls = (
content_type => 'text/x-github-pull-request',
can_review => 1,
},
+ reviewboard => {
+ title => 'MozReview',
+ regex => $mozreview_url_re,
+ content_type => 'text/x-review-board-request',
+ can_review => 0,
+ },
Phabricator => {
title => 'Phabricator',
regex => \&phabricator_url_re,