aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2019-03-15 14:52:54 -0400
committerSam James <sam@gentoo.org>2022-02-18 20:44:09 +0000
commitabfbdfc45c71af6a14bcc4cd5354044cfca14add (patch)
treef2520bb2e6043f84ee00e0f5f5ef376e5020537a
parenttemplate: add status_whiteboard to email headers (diff)
downloadbugzilla-abfbdfc45c71af6a14bcc4cd5354044cfca14add.tar.gz
bugzilla-abfbdfc45c71af6a14bcc4cd5354044cfca14add.tar.bz2
bugzilla-abfbdfc45c71af6a14bcc4cd5354044cfca14add.zip
Bug 1535376 - add support for upstream phabricator to the see-also fieldsgentoo-5.0.6.16
(from: https://github.com/mozilla-bteam/bmo/commit/fc3a97a79e15a15b8c66f9ff8088dd2b015d5ca4) Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--Bugzilla/BugUrl.pm1
-rw-r--r--Bugzilla/BugUrl/Phabricator.pm41
-rw-r--r--template/en/default/global/user-error.html.tmpl1
3 files changed, 43 insertions, 0 deletions
diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm
index 42e993bf4..9aa7ac7f5 100644
--- a/Bugzilla/BugUrl.pm
+++ b/Bugzilla/BugUrl.pm
@@ -66,6 +66,7 @@ use constant SUB_CLASSES => qw(
Bugzilla::BugUrl::SourceForge
Bugzilla::BugUrl::GitHub
Bugzilla::BugUrl::GitLab
+ Bugzilla::BugUrl::Phabricator
);
###############################
diff --git a/Bugzilla/BugUrl/Phabricator.pm b/Bugzilla/BugUrl/Phabricator.pm
new file mode 100644
index 000000000..b805248cf
--- /dev/null
+++ b/Bugzilla/BugUrl/Phabricator.pm
@@ -0,0 +1,41 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+package Bugzilla::BugUrl::Phabricator;
+
+use 5.10.1;
+use strict;
+use warnings;
+use base qw(Bugzilla::BugUrl);
+
+###############################
+#### Methods ####
+###############################
+
+sub should_handle {
+ my ($class, $uri) = @_;
+ # https://admin.phacility.com/PHI\d+
+ # https://secure.phabricator.com/T\d+
+ # https://secure.phabricator.com/D\d+
+ return ($uri->path =~ m#/(PHI|D|T)\d+$#) ? 1 : 0;
+}
+
+sub _check_value {
+ my $class = shift;
+
+ my $uri = $class->SUPER::_check_value(@_);
+
+ # Make sure there are no query parameters.
+ $uri->query(undef);
+
+ # And remove any # part if there is one.
+ $uri->fragment(undef);
+
+ return $uri;
+}
+
+1;
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 79611ebed..4ebb0b95b 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -293,6 +293,7 @@
<li>An issue/pull request on github.com.</li>
<li>An issue/merge request on a GitLab system.</li>
<li>A task on a Flyspray tracking system.</li>
+ <li>A revision, support ticket, or task in Phabricator.</li>
[% Hook.process('bug_url_invalid_tracker') %]
</ul>
[% END %]