diff options
author | Matt Selsky <selsky@columbia.edu> | 2014-11-24 19:36:43 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-01-30 21:32:37 +0000 |
commit | 51ae055728e7c266e8d192c8bfd836af17eda288 (patch) | |
tree | c71230e44756dbfeb273348effdbe53635161dc9 | |
parent | Add a custom 500 error page explaining attaching problems (diff) | |
download | bugzilla-51ae055728e7c266e8d192c8bfd836af17eda288.tar.gz bugzilla-51ae055728e7c266e8d192c8bfd836af17eda288.tar.bz2 bugzilla-51ae055728e7c266e8d192c8bfd836af17eda288.zip |
Bug 919122 - support for sourceforge.net Allura bugs in see_also field. r=gerv.
(cherry picked from commit 34f2b77f153f9f5ab4a4ef6723dcc31fff50a4d9)
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | Bugzilla/BugUrl/SourceForge.pm | 30 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 2 |
2 files changed, 25 insertions, 7 deletions
diff --git a/Bugzilla/BugUrl/SourceForge.pm b/Bugzilla/BugUrl/SourceForge.pm index ffdde42f4..c79b83b84 100644 --- a/Bugzilla/BugUrl/SourceForge.pm +++ b/Bugzilla/BugUrl/SourceForge.pm @@ -22,12 +22,25 @@ sub should_handle { # SourceForge tracker URLs have only one form: # http://sourceforge.net/tracker/?func=detail&aid=111&group_id=111&atid=111 - 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; + # 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 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 +51,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 4ebb0b95b..da14f55ad 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> <li>An issue/merge request on a GitLab system.</li> <li>A task on a Flyspray tracking system.</li> |