variable confusion in poller, don't allow negative page offsets
This commit is contained in:
parent
3b9c3d886d
commit
09f74be14c
3 changed files with 6 additions and 6 deletions
4
boot.php
4
boot.php
|
@ -432,7 +432,7 @@ if(! class_exists('App')) {
|
|||
* pagination
|
||||
*/
|
||||
|
||||
$this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
|
||||
$this->pager['page'] = ((x($_GET,'page') && intval($_GET['page']) > 0) ? intval($_GET['page']) : 1);
|
||||
$this->pager['itemspage'] = 50;
|
||||
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
|
||||
$this->pager['total'] = 0;
|
||||
|
@ -499,7 +499,7 @@ if(! class_exists('App')) {
|
|||
}
|
||||
|
||||
function set_pager_itemspage($n) {
|
||||
$this->pager['itemspage'] = intval($n);
|
||||
$this->pager['itemspage'] = ((intval($n) > 0) ? intval($n) : 0);
|
||||
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue