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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user