summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-08-13 23:59:02 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-08-13 23:59:02 +0200
commit8ebf35e43c3be63a6ad91239d4dee19ab50e769f (patch)
tree8e420d71ae28ead05d943d28925fe0f94eb6a5d1
parent4d8d27d21883d96bb66780f6418bbfd332dba9e7 (diff)
downloadbugzilla-8ebf35e43c3be63a6ad91239d4dee19ab50e769f.tar.gz
bugzilla-8ebf35e43c3be63a6ad91239d4dee19ab50e769f.tar.xz
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
-rw-r--r--Bugzilla/Bug.pm4
1 files changed, 3 insertions, 1 deletions
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];
}