From c393bc95635cc7b5584135bfd6f447dcc03c961b 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 6388f8e873..7ffda88e74 100644 --- a/plugins/OStatus/classes/HubSub.php +++ b/plugins/OStatus/classes/HubSub.php @@ -226,7 +226,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) { if (empty($pushCallbacks)) { common_log(LOG_ERR, 'Callback list empty for bulkDistribute.'); diff --git a/plugins/OStatus/lib/ostatusqueuehandler.php b/plugins/OStatus/lib/ostatusqueuehandler.php index 0376d13e52..fed93b6ea6 100644 --- a/plugins/OStatus/lib/ostatusqueuehandler.php +++ b/plugins/OStatus/lib/ostatusqueuehandler.php @@ -257,7 +257,7 @@ class OStatusQueueHandler extends QueueHandler } } } - if (count($batch) >= 0) { + if (count($batch) > 0) { $sub->bulkDistribute($atom, $batch); } } -- 2.39.5