From af3c857f728716f8d34bdfdb46d84f471c414cce Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Sun, 5 Aug 2007 19:02:59 +0000 Subject: [PATCH] Limit the current page to the available pages --- include/objectManager.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/objectManager.php b/include/objectManager.php index 428a543..49f26b5 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -709,6 +709,11 @@ class ObjectManager $iPage = isset($aClean['iPage']) ? $aClean['iPage'] : 1; $iCurrentPage = min($iPage, $iNumPages); + // if iPage is beyond the maximum number of pages, make it the + // highest page number + if($iPage > $iNumPages) + $iPage = $iNumPages; + /* Display selectors and info */ echo '
'; echo "Page $iPage of $iNumPages
";