From 095c2362347bea48a7a40b0f5321f9ea6015ab48 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 27 Jul 2011 08:48:00 -0500 Subject: [PATCH] Fixed empty result set bug in paginator class. --- system/paginator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/paginator.php b/system/paginator.php index e9d5861b..1045b831 100644 --- a/system/paginator.php +++ b/system/paginator.php @@ -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;