aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-11 17:24:16 -0700
committerfriendica <info@friendica.com>2012-06-11 17:24:16 -0700
commit09f74be14c94c722a63371cacd7e99a2e8bd7733 (patch)
tree78844fc916bf286a17bd54294c9217c747f69ef6
parent3b9c3d886d0c5fcc289950a2c4aeff8457a24217 (diff)
downloadvolse-hubzilla-09f74be14c94c722a63371cacd7e99a2e8bd7733.tar.gz
volse-hubzilla-09f74be14c94c722a63371cacd7e99a2e8bd7733.tar.bz2
volse-hubzilla-09f74be14c94c722a63371cacd7e99a2e8bd7733.zip
variable confusion in poller, don't allow negative page offsets
-rw-r--r--boot.php4
-rw-r--r--include/onepoll.php4
-rw-r--r--include/poller.php4
3 files changed, 6 insertions, 6 deletions
diff --git a/boot.php b/boot.php
index 45922f887..70dd1c426 100644
--- a/boot.php
+++ b/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'];
}
diff --git a/include/onepoll.php b/include/onepoll.php
index ba7d5ebaf..02763cf4b 100644
--- a/include/onepoll.php
+++ b/include/onepoll.php
@@ -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"))
diff --git a/include/poller.php b/include/poller.php
index 6b12445d1..fefc9b381 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -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)