Browse Source

variable confusion in poller, don't allow negative page offsets

pull/331/merge
friendica 9 years ago
parent
commit
09f74be14c
3 changed files with 6 additions and 6 deletions
  1. +2
    -2
      boot.php
  2. +2
    -2
      include/onepoll.php
  3. +2
    -2
      include/poller.php

+ 2
- 2
boot.php View File

@ -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'];
}


+ 2
- 2
include/onepoll.php View File

@ -94,8 +94,8 @@ function onepoll_run($argv, $argc){
$t = $contact['last-update'];
if($contact['subhub']) {
$interval = get_config('system','pushpoll_frequency');
$contact['priority'] = (($interval !== false) ? intval($interval) : 3);
$poll_interval = get_config('system','pushpoll_frequency');
$contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
$hub_update = false;
if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day"))


+ 2
- 2
include/poller.php View File

@ -201,8 +201,8 @@ function poller_run($argv, $argc){
if($contact['subhub']) {
$interval = get_config('system','pushpoll_frequency');
$contact['priority'] = (($interval !== false) ? intval($interval) : 3);
$poll_interval = get_config('system','pushpoll_frequency');
$contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
$hub_update = false;
if((datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day")) || $force)


Loading…
Cancel
Save