Skip to content

Commit

Permalink
Fix lower bound of total pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Aug 16, 2017
1 parent fb68e96 commit 4886b36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/Component/PaginatorComponent.php
Expand Up @@ -197,9 +197,9 @@ public function paginate($object, array $settings = [])

$page = $options['page'];
$limit = $options['limit'];
$pageCount = (int)ceil($count / $limit);
$pageCount = max((int)ceil($count / $limit), 1);
$requestedPage = $page;
$page = max(min($page, $pageCount), 1);
$page = min($page, $pageCount);
$request = $this->_registry->getController()->request;

$order = (array)$options['order'];
Expand Down

0 comments on commit 4886b36

Please sign in to comment.