Validates pagination vars
parent
522cded113
commit
101f4c539a
|
@ -6,11 +6,14 @@
|
||||||
* $totalPages - Total number of pages
|
* $totalPages - Total number of pages
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Ensure required variables are set
|
// Validate required pagination variables
|
||||||
if (!isset($currentPage) || !isset($totalPages)) {
|
if (!isset($currentPage) || !isset($totalPages)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure valid values
|
||||||
|
$currentPage = max(1, min($currentPage, $totalPages));
|
||||||
|
|
||||||
// Number of page links to show before and after current page
|
// Number of page links to show before and after current page
|
||||||
$range = 2;
|
$range = 2;
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue