Merge pull request #635 from 3Dgoo/patch-2

FIX Ensure pagination start is not a negative number
This commit is contained in:
Steve Boyd 2021-02-27 14:47:41 +13:00 committed by GitHub
commit 53dc1df1aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -457,7 +457,7 @@ class BlogController extends PageController
$posts->setPageLength($pageSize); $posts->setPageLength($pageSize);
// Set current page // Set current page
$start = (int)$this->request->getVar($posts->getPaginationGetVar()); $start = max(0, (int)$this->request->getVar($posts->getPaginationGetVar()));
$posts->setPageStart($start); $posts->setPageStart($start);
return $posts; return $posts;