Limit maximal number of rows in QBE
User would be lost in them anyway by that count and it prevents DOS. Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
3ef6201bd6
commit
45e33d63a2
@ -1940,7 +1940,10 @@ class DbQbe
|
||||
// sets row count
|
||||
$rows = PMA_ifSetOr($_REQUEST['rows'], 0, 'numeric');
|
||||
$criteriaRowAdd = PMA_ifSetOr($_REQUEST['criteriaRowAdd'], 0, 'numeric');
|
||||
$this->_criteria_row_count = max($rows + $criteriaRowAdd, 0);
|
||||
$this->_criteria_row_count = min(
|
||||
100,
|
||||
max($rows + $criteriaRowAdd, 0)
|
||||
);
|
||||
|
||||
return $criteriaColumnCount;
|
||||
}
|
||||
|
||||
@ -160,6 +160,16 @@ class SavedSearches
|
||||
}
|
||||
}
|
||||
|
||||
/* Limit amount of rows */
|
||||
if (!isset($data['rows'])) {
|
||||
$data['rows'] = 0;
|
||||
} else {
|
||||
$data['rows'] = min(
|
||||
max(0, intval($data['rows'])),
|
||||
100
|
||||
);
|
||||
}
|
||||
|
||||
for ($i = 0; $i <= $data['rows']; $i++) {
|
||||
$data['Or' . $i] = $criterias['Or' . $i];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user