Limit the current page to the available pages

This commit is contained in:
Chris Morgan
2007-08-05 19:02:59 +00:00
committed by WineHQ
parent cc955617bb
commit af3c857f72

View File

@@ -709,6 +709,11 @@ class ObjectManager
$iPage = isset($aClean['iPage']) ? $aClean['iPage'] : 1; $iPage = isset($aClean['iPage']) ? $aClean['iPage'] : 1;
$iCurrentPage = min($iPage, $iNumPages); $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 */ /* Display selectors and info */
echo '<div align="center">'; echo '<div align="center">';
echo "<b>Page $iPage of $iNumPages</b><br />"; echo "<b>Page $iPage of $iNumPages</b><br />";