From 8ebf35e43c3be63a6ad91239d4dee19ab50e769f Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 13 Aug 2015 23:59:02 +0200 Subject: Bug 1191937: If a bug comment contains a reference to a very large bug ID, the bug is no longer viewable with PostgreSQL r=gerv a=sgreen --- Bugzilla/Bug.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 2cc9aadb0..0ec29623e 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -533,7 +533,7 @@ sub _preload_referenced_bugs { my $referenced_bugs = Bugzilla::Bug->new_from_list(\@ref_bug_ids); $_->object_cache_set() foreach @$referenced_bugs; - return $referenced_bug_ids + return $referenced_bug_ids; } # Extract bug IDs mentioned in comments. This is much faster than calling quoteUrls(). @@ -566,6 +566,8 @@ sub _extract_bug_ids { # Old duplicate markers push @bug_ids, $text =~ /(?<=^\*\*\*\ This\ bug\ has\ been\ marked\ as\ a\ duplicate\ of\ )(\d+)(?=\ \*\*\*\Z)/; } + # Make sure to filter invalid bug IDs. + @bug_ids = grep { $_ < MAX_INT_32 } @bug_ids; return [uniq @bug_ids]; } -- cgit v1.2.3-24-g4f1b