diff options
author | Frédéric Buclin <LpSolit@netscape.net> | 2016-05-15 13:55:11 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@netscape.net> | 2016-05-15 13:55:11 +0200 |
commit | c12c092f9fd84cd0f5b5645f61e29fe1260063dc (patch) | |
tree | 8e6b38a23387a537ad091706e6bef58291842d46 /Bugzilla/Bug.pm | |
parent | a0f06d3134a63b577763e1f272b001182e5e645e (diff) | |
parent | 16dd96bdfdadea63e182f0954f06c187cb83e75b (diff) | |
download | bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar.gz bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar.bz2 bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.tar.xz bugs-c12c092f9fd84cd0f5b5645f61e29fe1260063dc.zip |
Merge branch '5.0' of https://git.mozilla.org/bugzilla/bugzilla
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 34bf95ff7..8b4493f85 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -305,15 +305,15 @@ sub new { my $param = shift; # Remove leading "#" mark if we've just been passed an id. - if (!ref $param && $param =~ /^#(\d+)$/) { + if (!ref $param && $param =~ /^#([0-9]+)$/) { $param = $1; } # If we get something that looks like a word (not a number), # make it the "name" param. if (!defined $param - || (!ref($param) && $param !~ /^\d+$/) - || (ref($param) && $param->{id} !~ /^\d+$/)) + || (!ref($param) && $param !~ /^[0-9]+$/) + || (ref($param) && $param->{id} !~ /^[0-9]+$/)) { if ($param) { my $alias = ref($param) ? $param->{id} : $param; @@ -556,15 +556,15 @@ sub _extract_bug_ids { my $s = $comment->already_wrapped ? qr/\s/ : qr/\h/; my $text = $comment->body; # Full bug links - push @bug_ids, $text =~ /\b$urlbase_re\Qshow_bug.cgi?id=\E(\d+)(?:\#c\d+)?/g; + push @bug_ids, $text =~ /\b$urlbase_re\Qshow_bug.cgi?id=\E([0-9]+)(?:\#c[0-9]+)?/g; # bug X - my $bug_re = qr/\Q$bug_word\E$s*\#?$s*(\d+)/i; + my $bug_re = qr/\Q$bug_word\E$s*\#?$s*([0-9]+)/i; push @bug_ids, $text =~ /\b$bug_re/g; # bugs X, Y, Z - my $bugs_re = qr/\Q$bugs_word\E$s*\#?$s*(\d+)(?:$s*,$s*\#?$s*(\d+))+/i; + my $bugs_re = qr/\Q$bugs_word\E$s*\#?$s*([0-9]+)(?:$s*,$s*\#?$s*([0-9]+))+/i; push @bug_ids, $text =~ /\b$bugs_re/g; # Old duplicate markers - push @bug_ids, $text =~ /(?<=^\*\*\*\ This\ bug\ has\ been\ marked\ as\ a\ duplicate\ of\ )(\d+)(?=\ \*\*\*\Z)/; + push @bug_ids, $text =~ /(?<=^\*\*\*\ This\ bug\ has\ been\ marked\ as\ a\ duplicate\ of\ )([0-9]+)(?=\ \*\*\*\Z)/; } # Make sure to filter invalid bug IDs. @bug_ids = grep { $_ < MAX_INT_32 } @bug_ids; |