From ace93239c350e28c8201d948ea0f5c9126c2759a Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 24 Oct 2013 13:15:38 +0800 Subject: Bug 930366: detection of github PRs not working with trailing '/' in urls --- extensions/BMO/Extension.pm | 2 +- extensions/BMO/bin/migrate-github-pull-requests.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'extensions') diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 1fdb7d3c2..5f236dea4 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -607,7 +607,7 @@ sub attachment_process_data { # trim and check for the pull request url $url = trim($url); return if $url =~ /\s/; - return unless $url =~ m#^https://github\.com/[^/]+/[^/]+/pull/\d+$#i; + return unless $url =~ m#^https://github\.com/[^/]+/[^/]+/pull/\d+\/?$#i; # must be a valid pull-request $attributes->{mimetype} = GITHUB_PR_CONTENT_TYPE; diff --git a/extensions/BMO/bin/migrate-github-pull-requests.pl b/extensions/BMO/bin/migrate-github-pull-requests.pl index eba0dd422..de71a7856 100755 --- a/extensions/BMO/bin/migrate-github-pull-requests.pl +++ b/extensions/BMO/bin/migrate-github-pull-requests.pl @@ -57,7 +57,7 @@ foreach my $attachment (@$attachments) { # check payload my $url = trim($attachment->{thedata}); next if $url =~ /\s/; - next unless $url =~ m#^https://github\.com/[^/]+/[^/]+/pull/\d+$#i; + next unless $url =~ m#^https://github\.com/[^/]+/[^/]+/pull/\d+\/?$#i; $dbh->bz_start_transaction; -- cgit v1.2.3-24-g4f1b