From: Matt Selsky Date: Mon, 24 Nov 2014 19:36:43 +0000 (+0000) Subject: Bug 919122 - support for sourceforge.net Allura bugs in see_also field. r=gerv. X-Git-Tag: release-5.1.1~444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34f2b77f153f9f5ab4a4ef6723dcc31fff50a4d9;p=thirdparty%2Fbugzilla.git Bug 919122 - support for sourceforge.net Allura bugs in see_also field. r=gerv. --- diff --git a/Bugzilla/BugUrl/SourceForge.pm b/Bugzilla/BugUrl/SourceForge.pm index acba0df28b..4a330f34b3 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 78d8823f5c..015f18525a 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -291,7 +291,7 @@
  • An issue in a JIRA installation.
  • A ticket in a Trac installation.
  • A b[% %]ug in a MantisBT installation.
  • -
  • A b[% %]ug on sourceforge.net.
  • +
  • A b[% %]ug or ticket on sourceforge.net.
  • An issue/pull request on github.com.
  • [% Hook.process('bug_url_invalid_tracker') %]