mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Only allow positive start values in PaginatedList
Otherwise the ORM query will fail.
This commit is contained in:
parent
b404e55533
commit
07db2e1fd1
@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user