summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugUrl
diff options
context:
space:
mode:
authorMatt Selsky <selsky@columbia.edu>2014-11-24 20:36:43 +0100
committerGervase Markham <gerv@gerv.net>2014-11-24 20:36:43 +0100
commit34f2b77f153f9f5ab4a4ef6723dcc31fff50a4d9 (patch)
tree272edd6482344dd0b268b85511483a448679bf03 /Bugzilla/BugUrl
parent3afc1b782bca835fd0a35e7162b29c1972704eff (diff)
downloadbugzilla-34f2b77f153f9f5ab4a4ef6723dcc31fff50a4d9.tar.gz
bugzilla-34f2b77f153f9f5ab4a4ef6723dcc31fff50a4d9.tar.xz
Bug 919122 - support for sourceforge.net Allura bugs in see_also field. r=gerv.
Diffstat (limited to 'Bugzilla/BugUrl')
-rw-r--r--Bugzilla/BugUrl/SourceForge.pm21
1 files changed, 16 insertions, 5 deletions
diff --git a/Bugzilla/BugUrl/SourceForge.pm b/Bugzilla/BugUrl/SourceForge.pm
index acba0df28..4a330f34b 100644
--- a/Bugzilla/BugUrl/SourceForge.pm
+++ b/Bugzilla/BugUrl/SourceForge.pm
@@ -22,12 +22,18 @@ sub should_handle {
# SourceForge tracker URLs have only one form:
# http://sourceforge.net/tracker/?func=detail&aid=111&group_id=111&atid=111
+ # SourceForge Allura ticket URLs have several forms:
+ # http://sourceforge.net/p/project/bugs/12345/
+ # http://sourceforge.net/p/project/feature-requests/12345/
+ # http://sourceforge.net/p/project/patches/12345/
+ # http://sourceforge.net/p/project/support-requests/12345/
return (lc($uri->authority) eq 'sourceforge.net'
- and $uri->path =~ m|/tracker/|
- and $uri->query_param('func') eq 'detail'
- and $uri->query_param('aid')
- and $uri->query_param('group_id')
- and $uri->query_param('atid')) ? 1 : 0;
+ and (($uri->path eq '/tracker/'
+ and $uri->query_param('func') eq 'detail'
+ and $uri->query_param('aid')
+ and $uri->query_param('group_id')
+ and $uri->query_param('atid'))
+ or $uri->path =~ m!^/p/[^/]+/(?:bugs|feature-requests|patches|support-requests)/\d+/?$!)) ? 1 : 0;
}
sub _check_value {
@@ -38,6 +44,11 @@ sub _check_value {
# Remove any # part if there is one.
$uri->fragment(undef);
+ # Make sure the trailing slash is present
+ my $path = $uri->path;
+ $path =~ s!/*$!/!;
+ $uri->path($path);
+
return $uri;
}