Fixed empty result set bug in paginator class.
This commit is contained in:
parent
c870fdbe57
commit
095c236234
|
@ -93,7 +93,7 @@ public static function page($total, $per_page)
|
|||
|
||||
if (is_numeric($page) and $page > $last_page = ceil($total / $per_page))
|
||||
{
|
||||
return $last_page;
|
||||
return ($last_page > 0) ? $last_page : 1;
|
||||
}
|
||||
|
||||
return ($page < 1 or filter_var($page, FILTER_VALIDATE_INT) === false) ? 1 : $page;
|
||||
|
|
Loading…
Reference in New Issue