summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-02-20 08:44:03 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-02-20 08:44:03 +0100
commit60712d5d6f5db2a468bea0447744c06d5e8a487c (patch)
treea067c48617f748d6543b6d2759cd6e5ccdccff5c /Bugzilla/Search.pm
parent6aad3a0979417a4e131a2ac45ceabfe840aa4af6 (diff)
downloadbugzilla-60712d5d6f5db2a468bea0447744c06d5e8a487c.tar.gz
bugzilla-60712d5d6f5db2a468bea0447744c06d5e8a487c.tar.xz
Bug 632717: Limit the total number of results that a search can ever return.
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r--Bugzilla/Search.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 224193fbc..2bd4c06c9 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -929,6 +929,12 @@ sub _sql_limit {
my ($self) = @_;
my $limit = $self->_params->{limit};
my $offset = $self->_params->{offset};
+
+ my $max_results = Bugzilla->params->{'max_search_results'};
+ if (!$self->{allow_unlimited} && (!$limit || $limit > $max_results)) {
+ $limit = $max_results;
+ }
+
if (defined $offset and not defined $limit) {
$limit = INT_MAX;
}