Skip to content

Commit

Permalink
fix issue matching (and warnings)
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Nov 18, 2016
1 parent 32af13e commit 0ed4902
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/MetaCPAN/Web/Model/ReleaseInfo.pm
Expand Up @@ -216,7 +216,7 @@ sub normalize_issues {
= $self->rt_url_prefix . uri_escape( $release->{distribution} );
}

if ( my $bugs = $distribution->{bugs} ) {
for my $bugs ( values %{ $distribution->{bugs} || {} } ) {

# Include the active issue count, but only if counts came from the same
# source as the url specified in the resources.
Expand All @@ -238,11 +238,19 @@ sub normalize_issues {
}
sub normalize_issue_url {
local $_ = $_[1];
s{^https?:// (?:www\.)? ( github\.com / ([^/]+) / ([^/]+) ) (.*)$}{https://$1}x;

return $_;
my ( $self, $url ) = @_;
$url
=~ s{^https?:// (?:www\.)? ( github\.com / ([^/]+) / ([^/]+) ) (.*)$}{https://$1}x;
$url =~ s{
^https?:// rt\.cpan\.org /
(?:
NoAuth/Bugs\.html\?Dist=
|
(?:Public/)?Dist/Display\.html\?Name=
)
}{https://rt.cpan.org/Public/Dist/Display.html?Name=}x;

return $url;
}

__PACKAGE__->meta->make_immutable;
Expand Down

0 comments on commit 0ed4902

Please sign in to comment.