From: Mikael Nordfeldth Date: Sat, 16 Jan 2016 16:18:14 +0000 (+0100) Subject: In very specific circumstances we can bulkDistribute 0 notices X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b67b53112bbd2303bff054aba19be94bd09f860;p=quix0rs-gnu-social.git In very specific circumstances we can bulkDistribute 0 notices Seems to be what caused an infinite loop on quitter.es, or I guess so anyway. --- diff --git a/plugins/OStatus/classes/HubSub.php b/plugins/OStatus/classes/HubSub.php index a46bba5cc6..7eba8937fa 100644 --- a/plugins/OStatus/classes/HubSub.php +++ b/plugins/OStatus/classes/HubSub.php @@ -249,7 +249,7 @@ class HubSub extends Managed_DataObject * @param string $atom well-formed Atom feed * @param array $pushCallbacks list of callback URLs */ - function bulkDistribute($atom, $pushCallbacks) + function bulkDistribute($atom, array $pushCallbacks) { $data = array('atom' => $atom, 'topic' => $this->getTopic(), diff --git a/plugins/OStatus/lib/ostatusqueuehandler.php b/plugins/OStatus/lib/ostatusqueuehandler.php index 6e00f49b98..2358176ec2 100644 --- a/plugins/OStatus/lib/ostatusqueuehandler.php +++ b/plugins/OStatus/lib/ostatusqueuehandler.php @@ -255,7 +255,7 @@ class OStatusQueueHandler extends QueueHandler } } } - if (count($batch) >= 0) { + if (count($batch) > 0) { $sub->bulkDistribute($atom, $batch); } }