Check limit and offset parameters sent to controller

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/39756/head
Côme Chilliet 2 years ago
parent afcebd1e92
commit e51d20479e
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 7
      apps/provisioning_api/lib/Controller/UsersController.php

@ -246,6 +246,13 @@ class UsersController extends AUserData {
if ($currentUser === null) {
return new DataResponse(['users' => []]);
}
if ($limit !== null && $limit < 0) {
throw new InvalidArgumentException("Invalid limit value: $limit");
}
if ($offset < 0) {
throw new InvalidArgumentException("Invalid offset value: $offset");
}
$users = [];
// Admin? Or SubAdmin?

Loading…
Cancel
Save