From b42d1443b54f7fa712294e449583a2ade1c2af62 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 22 Aug 2005 00:49:33 +0000 Subject: [PATCH] r358: Set limits different in fetch_limit() under certain conditions --- includes/class_pagination.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/class_pagination.php b/includes/class_pagination.php index 81dee53..4afd3a9 100644 --- a/includes/class_pagination.php +++ b/includes/class_pagination.php @@ -109,17 +109,19 @@ class Pagination $page = $this->page; } + $limit = $page * $this->perpage; + if ($page < 1) { $page = 1; + $limit = 0; } else if ($page > $this->pagecount) { $page = $this->pagecount - 1; + $limit = $this->total; } - $limit = $page * $this->perpage; - if ($limit < 0) { return 0; -- 2.22.5