From 07db2e1fd15e432ab6a241732f58a278af941f10 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 28 Aug 2013 17:31:23 +0200 Subject: [PATCH] Only allow positive start values in PaginatedList Otherwise the ORM query will fail. --- core/PaginatedList.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/PaginatedList.php b/core/PaginatedList.php index 3cdd456b5..acb81fd71 100644 --- a/core/PaginatedList.php +++ b/core/PaginatedList.php @@ -91,8 +91,12 @@ class PaginatedList extends SS_ListDecorator { */ public function getPageStart() { if ($this->pageStart === null) { - if ($this->request && isset($this->request[$this->getPaginationGetVar()])) { - $this->pageStart = (int) $this->request[$this->getPaginationGetVar()]; + if( + $this->request + && isset($this->request[$this->getPaginationGetVar()]) + && $this->request[$this->getPaginationGetVar()] > 0 + ) { + $this->pageStart = (int)$this->request[$this->getPaginationGetVar()]; } else { $this->pageStart = 0; } @@ -417,4 +421,4 @@ class PaginatedList extends SS_ListDecorator { } } -} +} \ No newline at end of file