From: Dylan William Hardison Date: Wed, 21 Nov 2018 19:33:12 +0000 (-0500) Subject: Bug 1508912 - Searchfox URLs are broken in bug comments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df1142c72d92229493d47a355459d70790fcaaf;p=thirdparty%2Fbugzilla.git Bug 1508912 - Searchfox URLs are broken in bug comments --- diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index ab8aae161..d093be29c 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -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#$owner/$repo\#$number#; + my $owner = html_quote($args->{matches}->[1]); + my $repo = html_quote($args->{matches}->[2]); + my $number = html_quote($args->{matches}->[3]); + return qq# $owner/$repo\#$number#; } });