Fixed empty result set bug in paginator class.

This commit is contained in:
Taylor Otwell 2011-07-27 08:48:00 -05:00
parent c870fdbe57
commit 095c236234
1 changed files with 1 additions and 1 deletions

View File

@ -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;