]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1508912 - Searchfox URLs are broken in bug comments
authorDylan William Hardison <dylan@hardison.net>
Wed, 21 Nov 2018 19:33:12 +0000 (14:33 -0500)
committerGitHub <noreply@github.com>
Wed, 21 Nov 2018 19:33:12 +0000 (14:33 -0500)
extensions/BMO/Extension.pm

index ab8aae161a68ca8863982e022fbb2a1a66997ac4..d093be29ca19a2a56887bf9a4c4b2a3f1b57510b 100644 (file)
@@ -724,13 +724,13 @@ sub bug_format_comment {
 
     # link github pull requests and issues
     push (@$regexes, {
-        match => qr/(?!\w+\/)([\w\.-]+)\/([\w\.-]+)\#(\d+)\b/,
+        match => qr/(\s)([A-Za-z0-9_\.-]+)\/([A-Za-z0-9_\.-]+)\#([0-9]+)\b/,
         replace => sub {
             my $args = shift;
-            my $owner = html_quote($args->{matches}->[0]);
-            my $repo = html_quote($args->{matches}->[1]);
-            my $number = html_quote($args->{matches}->[2]);
-            return qq#<a href="https://github.com/$owner/$repo/issues/$number">$owner/$repo\#$number</a>#;
+            my $owner = html_quote($args->{matches}->[1]);
+            my $repo = html_quote($args->{matches}->[2]);
+            my $number = html_quote($args->{matches}->[3]);
+            return qq# <a href="https://github.com/$owner/$repo/issues/$number">$owner/$repo\#$number</a>#;
         }
     });