mirror of
https://github.com/shlinkio/shlink.git
synced 2025-01-24 07:16:44 -06:00
Ensured pagination params in visits list are properly parsed to integer
This commit is contained in:
parent
4d2684be52
commit
1d4ef4e9a4
@ -92,4 +92,7 @@ WORKDIR /home/shlink
|
||||
# Expose swoole port
|
||||
EXPOSE 8080
|
||||
|
||||
CMD /usr/local/bin/composer update && ./vendor/bin/zend-expressive-swoole start
|
||||
CMD /usr/local/bin/composer update && \
|
||||
# When restarting the container, swoole might think it is already in execution
|
||||
# This forces the app to be started every second until the exit code is 0
|
||||
until php ./vendor/bin/zend-expressive-swoole start; do sleep 1 ; done
|
||||
|
@ -27,7 +27,11 @@ final class VisitsParams
|
||||
$startDate = self::getDateQueryParam($query, 'startDate');
|
||||
$endDate = self::getDateQueryParam($query, 'endDate');
|
||||
|
||||
return new self(new DateRange($startDate, $endDate), $query['page'] ?? 1, $query['itemsPerPage'] ?? null);
|
||||
return new self(
|
||||
new DateRange($startDate, $endDate),
|
||||
(int) ($query['page'] ?? 1),
|
||||
isset($query['itemsPerPage']) ? (int) $query['itemsPerPage'] : null
|
||||
);
|
||||
}
|
||||
|
||||
private static function getDateQueryParam(array $query, string $key): ?Chronos
|
||||
|
Loading…
Reference in New Issue
Block a user