fix: throw exception when outbox not found, #3255 (#3260)

This commit is contained in:
Dag 2023-02-15 21:42:05 +01:00 committed by GitHub
parent c27a300e02
commit 286790727b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 17 deletions

View file

@ -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'];

View file

@ -1,17 +0,0 @@
<?php
namespace RssBridge\Tests\Bridges;
use PHPUnit\Framework\TestCase;
class MastodonBridgeTest extends TestCase
{
public function test()
{
\Configuration::loadConfiguration(['cache' => ['type' => 'null']]);
$b = new \MastodonBridge();
// https://bird.makeup/users/asmongold/remote_follow
$b->setDatas(['canusername' => '@asmongold@bird.makeup']);
$b->collectData();
}
}