diff options
author | Frédéric Buclin <LpSolit@netscape.net> | 2018-04-19 20:21:19 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@netscape.net> | 2018-04-19 20:21:19 +0200 |
commit | 7fee353ce5190f5e08bb05fd9b29e24fdd4dc654 (patch) | |
tree | 91c7fa2c8fac5c2d6af7426fcd45f92716581f9f | |
parent | c52e3c6e8ad547ec035309994144fd22e2925267 (diff) | |
download | bugs-7fee353ce5190f5e08bb05fd9b29e24fdd4dc654.tar bugs-7fee353ce5190f5e08bb05fd9b29e24fdd4dc654.tar.gz bugs-7fee353ce5190f5e08bb05fd9b29e24fdd4dc654.tar.bz2 bugs-7fee353ce5190f5e08bb05fd9b29e24fdd4dc654.tar.xz bugs-7fee353ce5190f5e08bb05fd9b29e24fdd4dc654.zip |
Backport upstream bug 919122: Support for SourceForge Allura bugs in "see also" field
-rw-r--r-- | Bugzilla/BugUrl/SourceForge.pm | 21 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 2 |
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 dcf4fc789..234a65bf4 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -289,7 +289,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> |