Skip to content
Snippets Groups Projects
Commit ec51bc89 authored by Tobias Gross-Vogt's avatar Tobias Gross-Vogt
Browse files

lower limit for page and perPage

parent 0183be15
No related branches found
No related tags found
No related merge requests found
Pipeline #204666 failed
...@@ -32,12 +32,12 @@ class Pagination ...@@ -32,12 +32,12 @@ class Pagination
public static function getCurrentPageNumber(array $options): int public static function getCurrentPageNumber(array $options): int
{ {
return intval($options[self::CURRENT_PAGE_NUMBER_PARAMETER_NAME] ?? self::CURRENT_PAGE_NUMBER_DEFAULT); return max(1, intval($options[self::CURRENT_PAGE_NUMBER_PARAMETER_NAME]) ?? self::CURRENT_PAGE_NUMBER_DEFAULT);
} }
public static function getMaxNumItemsPerPage(array $options): int public static function getMaxNumItemsPerPage(array $options): int
{ {
return intval($options[self::MAX_NUM_ITEMS_PER_PAGE_PARAMETER_NAME] ?? self::MAX_NUM_ITEMS_PER_PAGE_DEFAULT); return max(1, intval($options[self::MAX_NUM_ITEMS_PER_PAGE_PARAMETER_NAME]) ?? self::MAX_NUM_ITEMS_PER_PAGE_DEFAULT);
} }
public static function isPartialPagination(array $options): bool public static function isPartialPagination(array $options): bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment