]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Are you sure you want to check in on branch master
authorMatt Selsky <selsky@columbia.edu>
Mon, 24 Nov 2014 17:05:30 +0000 (17:05 +0000)
committerGervase Markham <gerv@gerv.net>
Mon, 24 Nov 2014 17:05:30 +0000 (17:05 +0000)
Bugzilla/BugUrl/SourceForge.pm
template/en/default/global/user-error.html.tmpl

index acba0df28b78f22078bb9ed4fa50233e7cf5e413..4a330f34b358ca6a80be3fbaeb239d0e528dcc8b 100644 (file)
@@ -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;
 }
 
index 78d8823f5cfdde6809cef68642855f41d8317492..015f18525a1d9f67ea77d64779743ac88bc13688 100644 (file)
         <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>