-
- return undef if $self->_fetch;
-
- eval {
- my $tree = HTML::TreeBuilder->new_from_file($self->file);
-
- my $closed = $tree->look_down('id' => 'taskclosed');
- if ($closed) {
- my $str = $closed->as_HTML;
- if ($str =~ m!<strong>Reason for closing:</strong>[^\n]+\bFixed\b!) {
- $str =~ s!\n!!g;
- $str =~ s!<! <!g;
-
- my @refs = $str =~ m!\b (
- https?://git\.(?:openwrt|lede-project)\.org/\?p=[\w/]+\.git\S*;h=[a-fA-F0-9]{4,40} |
- https?://git\.(?:openwrt|lede-project)\.org/[a-fA-F0-9]{4,40} |
- https?://github\.com/[^/]+/commit/[a-fA-F0-9]{4,40} |
- [a-fA-F0-9]{7,40}
- ) \b!x;
-
- return @refs if @refs > 0;
- }
- }
-
- foreach my $comment (reverse $tree->look_down('class' => 'commenttext')) {
- my $str = $comment->as_HTML;
- my @refs = $str =~ m!
- (?:
- Fixed \s+ with \s+ |
- Fixed \s+ in \s+ |
- fix \s+ (?: in | into ) \s+ (?: \w+ \s+ )*
- )
- (?: <a \s+ href=" )? # "
- \b (
- https?://git\.(?:openwrt|lede-project)\.org/\?p=[\w/]+\.git\S*;h=[a-fA-F0-9]{4,40} |
- https?://git\.(?:openwrt|lede-project)\.org/[a-fA-F0-9]{4,40} |
- https?://github\.com/[^/]+/commit/[a-fA-F0-9]{4,40} |
- [a-fA-F0-9]{7,40}
- ) \b
- !ixg;
-
- return @refs if @refs > 0;
- }
- };
+ my $comments = $self->_fetch;
+
+ return undef unless $comments;
+
+ foreach my $comment (@$comments) {
+ my $str = $comment->{'body'};
+ my @refs = $str =~ m!
+ (?:
+ Fixed \s+ with \s+ |
+ Fixed \s+ in \s+ |
+ Fixed \s+ by \s+ |
+ fix \s+ (?: in | into ) \s+ (?: \w+ \s+ )*
+ )
+ (?: <a \s+ href=" )? # "
+ \b (
+ https?://git\.(?:openwrt|lede-project)\.org/\?p=[\w/]+\.git\S*;h=[a-fA-F0-9]{4,40} |
+ https?://git\.(?:openwrt|lede-project)\.org/[a-fA-F0-9]{4,40} |
+ https?://github\.com/[^/]+/commit/[a-fA-F0-9]{4,40} |
+ [a-fA-F0-9]{7,40}
+ ) \b
+ !ixg;
+
+ return @refs if @refs > 0;
+ }