1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-09 10:06:33 +02:00

fix: mastodon, cache tweaks, docs (#3661)

* cache tweaks

* docs

* fix(mastodon): type bug
This commit is contained in:
Dag
2023-09-10 23:35:40 +02:00
committed by GitHub
parent 4b9f6f7e53
commit 3178deb5a8
4 changed files with 19 additions and 5 deletions

View File

@@ -100,6 +100,10 @@ class MastodonBridge extends BridgeAbstract
// We fetch the boosted content.
try {
$rtContent = $this->fetchAP($content['object']);
if (!$rtContent) {
// Sometimes fetchAP returns null. Someone should figure out why. json_decode failure?
break;
}
$rtUser = $this->loadCacheValue($rtContent['attributedTo']);
if (!isset($rtUser)) {
// We fetch the author, since we cannot always assume the format of the URL.
@@ -277,6 +281,10 @@ class MastodonBridge extends BridgeAbstract
array_push($headers, $sig);
}
}
return json_decode(getContents($url, $headers), true);
try {
return Json::decode(getContents($url, $headers));
} catch (\JsonException $e) {
return null;
}
}
}