diff --git a/lib/Cake/Controller/Component/PaginatorComponent.php b/lib/Cake/Controller/Component/PaginatorComponent.php index 7fd20fe5b..53144ec6f 100644 --- a/lib/Cake/Controller/Component/PaginatorComponent.php +++ b/lib/Cake/Controller/Component/PaginatorComponent.php @@ -202,8 +202,8 @@ class PaginatorComponent extends Component { $count = 0; } elseif ($object->hasMethod('paginateCount')) { $count = $object->paginateCount($conditions, $recursive, $extra); - } elseif (count($results) < $limit && $page==1) { - $count = count($results); // no point in finding the count if it's less than our limit and we're on the first page + } elseif ($page === 1 && count($results) < $limit) { + $count = count($results); } else { $parameters = compact('conditions'); if ($recursive != $object->recursive) {