fix: Sanitise integer query parameters (#3064)

This commit is contained in:
Sami Mazouz 2021-09-17 20:50:11 +01:00 committed by GitHub
parent 44a80fc8fb
commit 0fea85d37c

View File

@ -236,7 +236,7 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
*/
protected function extractOffset(ServerRequestInterface $request)
{
return $this->buildParameters($request)->getOffset($this->extractLimit($request)) ?: 0;
return (int) $this->buildParameters($request)->getOffset($this->extractLimit($request)) ?: 0;
}
/**
@ -245,7 +245,7 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
*/
protected function extractLimit(ServerRequestInterface $request)
{
return $this->buildParameters($request)->getLimit($this->maxLimit) ?: $this->limit;
return (int) $this->buildParameters($request)->getLimit($this->maxLimit) ?: $this->limit;
}
/**