Skip to content

Commit

Permalink
fix: Sanitise integer query parameters (#3064)
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 authored Sep 17, 2021
1 parent c10a30b commit c1a8c6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Api/Controller/AbstractSerializeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected function extractSort(ServerRequestInterface $request)
*/
protected function extractOffset(ServerRequestInterface $request)
{
return $this->buildParameters($request)->getOffset($this->extractLimit($request)) ?: 0;
return (int) $this->buildParameters($request)->getOffset($this->extractLimit($request)) ?: 0;
}

/**
Expand All @@ -245,7 +245,7 @@ protected function extractOffset(ServerRequestInterface $request)
*/
protected function extractLimit(ServerRequestInterface $request)
{
return $this->buildParameters($request)->getLimit($this->maxLimit) ?: $this->limit;
return (int) $this->buildParameters($request)->getLimit($this->maxLimit) ?: $this->limit;
}

/**
Expand Down

0 comments on commit c1a8c6c

Please sign in to comment.