mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 20:37:15 +08:00
fix: Sanitise integer query parameters (#3064)
This commit is contained in:
parent
44a80fc8fb
commit
0fea85d37c
|
@ -236,7 +236,7 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
|
||||||
*/
|
*/
|
||||||
protected function extractOffset(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -245,7 +245,7 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
|
||||||
*/
|
*/
|
||||||
protected function extractLimit(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user