Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
60712d5d
Commit
60712d5d
authored
Feb 19, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 632717: Limit the total number of results that a search can ever return.
r=mkanat, a=mkanat (module owner)
parent
6aad3a09
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
+24
-4
Query.pm
Bugzilla/Config/Query.pm
+8
-2
Search.pm
Bugzilla/Search.pm
+6
-0
report.cgi
report.cgi
+5
-2
query.html.tmpl
template/en/default/admin/params/query.html.tmpl
+5
-0
No files found.
Bugzilla/Config/Query.pm
View file @
60712d5d
...
...
@@ -71,8 +71,14 @@ sub get_param_list {
name
=>
'specific_search_allow_empty_words'
,
type
=>
'b'
,
default
=>
1
}
},
{
name
=>
'max_search_results'
,
type
=>
't'
,
default
=>
'10000'
,
checker
=>
\&
check_numeric
},
);
return
@param_list
;
}
...
...
Bugzilla/Search.pm
View file @
60712d5d
...
...
@@ -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
;
}
...
...
report.cgi
View file @
60712d5d
...
...
@@ -127,8 +127,11 @@ my @axis_fields = ($row_field || EMPTY_COLUMN,
# Clone the params, so that Bugzilla::Search can modify them
my
$params
=
new
Bugzilla::
CGI
(
$cgi
);
my
$search
=
new
Bugzilla::
Search
(
'fields'
=>
\
@axis_fields
,
'params'
=>
scalar
$params
->
Vars
);
my
$search
=
new
Bugzilla::
Search
(
fields
=>
\
@axis_fields
,
params
=>
scalar
$params
->
Vars
,
allow_unlimited
=>
1
,
);
my
$query
=
$search
->
sql
;
$::SIG
{
TERM
}
=
'DEFAULT'
;
...
...
template/en/default/admin/params/query.html.tmpl
View file @
60712d5d
...
...
@@ -55,4 +55,9 @@
"Whether to allow a search on the 'Simple Search' page with an empty"
_ " 'Words' field.",
max_search_results =>
"The maximum number of $terms.bugs that a search can"
_ " <strong>ever</strong> return. Tabular and graphical reports"
_ " are exempted from this limit, however."
} %]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment