Fix bad math in page counter.

This commit is contained in:
James Cole
2023-04-22 06:42:26 +02:00
parent a38f909919
commit 9b1319f970

View File

@@ -85,12 +85,14 @@ abstract class Controller extends BaseController
{
$bag = new ParameterBag();
$page = (int)request()->get('page');
Log::debug(sprintf('Page is %d', $page));
if ($page < 1) {
$page = 1;
Log::debug(sprintf('Page is less than zero, is now %d', $page));
}
if ($page > (2 ^ 16)) {
$page = (2 ^ 16);
if ($page > pow(2,16)) {
$page = pow(2,16);
Log::debug(sprintf('Page is more than %d, is now %d', pow(2,16), $page));
}
$bag->set('page', $page);