diff --git a/src/inc/apiv2/common/AbstractBaseAPI.class.php b/src/inc/apiv2/common/AbstractBaseAPI.class.php index fa2de0c9f..97e6920f2 100644 --- a/src/inc/apiv2/common/AbstractBaseAPI.class.php +++ b/src/inc/apiv2/common/AbstractBaseAPI.class.php @@ -1042,12 +1042,15 @@ protected function makeFilter(array $filters, object $apiClass): array { if (is_null($value)) { throw new HttpForbidden("Filter parameter '" . $filter . "' is not valid boolean value"); } + $value = (int)$value; break; case 'int': $value = filter_var($value, FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); if (is_null($value)) { throw new HttpForbidden("Filter parameter '" . $filter . "' is not valid integer value"); } + $value = (int)$value; + break; } } unset($value); @@ -1539,4 +1542,4 @@ protected static function getMetaResponse(array $meta, Request $request, Respons static public function getAvailableMethods(): array { return ["GET", "POST", "PATCH", "DELETE"]; } -} \ No newline at end of file +}