fix: [counter graphs] fixed to disallow invalid interval entries

- as reported by SK-CERT
cli-modification-summary
iglocska 2022-09-19 01:46:57 +02:00
parent ca65c4b68e
commit 4c0c6ef4ac
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 10 additions and 1 deletions

View File

@ -144,8 +144,17 @@ class CRUDComponent extends Component
if (is_string($statIgnoreNull)) {
$statIgnoreNull = $statIgnoreNull == 'true' ? true : false;
}
$statistics_entry_amount = $this->request->getQuery('statistics_entry_amount');
if (
!is_numeric($statistics_entry_amount) ||
intval($statistics_entry_amount) <= 0
) {
$statistics_entry_amount = 5;
} else {
$statistics_entry_amount = intval($statistics_entry_amount);
}
$statsOptions = [
'limit' => !is_numeric($this->request->getQuery('statistics_entry_amount')) ? 5 : $this->request->getQuery('statistics_entry_amount'),
'limit' => $statistics_entry_amount,
'includeOthers' => $statIncludeRemaining,
'ignoreNull' => $statIgnoreNull,
];