summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Selsky <selsky@columbia.edu>2014-11-24 18:05:30 +0100
committerGervase Markham <gerv@gerv.net>2014-11-24 18:05:30 +0100
commit9e1efb5e001b8540672f42bfd7101fed4a394c0e (patch)
tree969186fcf3fd07e0e6cfd20658a8bdece2ea4e43
parent82674d427a9b6f210347279dbb74da631f3d57cb (diff)
downloadbugzilla-9e1efb5e001b8540672f42bfd7101fed4a394c0e.tar.gz
bugzilla-9e1efb5e001b8540672f42bfd7101fed4a394c0e.tar.xz
Are you sure you want to check in on branch master
-rw-r--r--Bugzilla/BugUrl/SourceForge.pm21
-rw-r--r--template/en/default/global/user-error.html.tmpl2
2 files changed, 17 insertions, 6 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;
}
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 78d8823f5..015f18525 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -291,7 +291,7 @@
<li>An issue in a JIRA installation.</li>
<li>A ticket in a Trac installation.</li>
<li>A b[% %]ug in a MantisBT installation.</li>
- <li>A b[% %]ug on sourceforge.net.</li>
+ <li>A b[% %]ug or ticket on sourceforge.net.</li>
<li>An issue/pull request on github.com.</li>
[% Hook.process('bug_url_invalid_tracker') %]
</ul>