]> git.mxchange.org Git - friendica.git/commitdiff
variable confusion in poller, don't allow negative page offsets
authorfriendica <info@friendica.com>
Tue, 12 Jun 2012 00:24:16 +0000 (17:24 -0700)
committerfriendica <info@friendica.com>
Tue, 12 Jun 2012 00:24:16 +0000 (17:24 -0700)
boot.php
include/onepoll.php
include/poller.php

index 45922f887051756e5c3666aeb8cf044cae561fc2..70dd1c4268c8053a73845a6d55279d2d38f90416 100644 (file)
--- 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'];
 
                }
index ba7d5ebaf5809b46101f7119cc993941bede275b..02763cf4bad070765e56e25bbb47ff19c18b15a8 100644 (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"))
index 6b12445d195004f53d54bbc9143bf1f6dff49bb9..fefc9b381d4a6c18d74cdb20eff26b57aaa42a38 100644 (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)