From 286790727bad17e103238d73a5ce1d7893c5e5e7 Mon Sep 17 00:00:00 2001 From: Dag Date: Wed, 15 Feb 2023 21:42:05 +0100 Subject: [PATCH] fix: throw exception when outbox not found, #3255 (#3260) --- bridges/MastodonBridge.php | 3 +++ tests/Bridges/MastodonBridgeTest.php | 17 ----------------- 2 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 tests/Bridges/MastodonBridgeTest.php diff --git a/bridges/MastodonBridge.php b/bridges/MastodonBridge.php index b02e5601..372838ca 100644 --- a/bridges/MastodonBridge.php +++ b/bridges/MastodonBridge.php @@ -62,6 +62,9 @@ class MastodonBridge extends BridgeAbstract public function collectData() { $user = $this->fetchAP($this->getURI()); + if (!isset($user['outbox'])) { + throw new \Exception('Unable to find the outbox'); + } $content = $this->fetchAP($user['outbox']); if (is_array($content['first'])) { // mobilizon $content = $content['first']; diff --git a/tests/Bridges/MastodonBridgeTest.php b/tests/Bridges/MastodonBridgeTest.php deleted file mode 100644 index 23baf5b6..00000000 --- a/tests/Bridges/MastodonBridgeTest.php +++ /dev/null @@ -1,17 +0,0 @@ - ['type' => 'null']]); - $b = new \MastodonBridge(); - // https://bird.makeup/users/asmongold/remote_follow - $b->setDatas(['canusername' => '@asmongold@bird.makeup']); - $b->collectData(); - } -}