It seems that both Cake version include some code that takes care of a too high page
parameter:
Cake 1.3: Controller->paginate()
if ($page === 'last' || $page >= $pageCount) {
$options['page'] = $page = $pageCount;
} elseif (intval($page) < 1) {
$options['page'] = $page = 1;
}
Cake 2.3: PaginatorComponent->paginate()
$pageCount = intval(ceil($count / $limit));
$page = max(min($page, $pageCount), 1);
But interestingly, in Cake 2.3, this code is placed after the call to find()
, so too late to fetch the records correctly. It may be a never signaled bug.