From 2b67b53112bbd2303bff054aba19be94bd09f860 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 16 Jan 2016 17:18:14 +0100 Subject: [PATCH] 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. --- plugins/OStatus/classes/HubSub.php | 2 +- plugins/OStatus/lib/ostatusqueuehandler.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); } }