1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

fix: various fixes (#3741)

This commit is contained in:
Dag
2023-10-12 19:49:04 +02:00
committed by GitHub
parent d21f8cebf6
commit 6a72c56cdd
3 changed files with 28 additions and 19 deletions

View File

@@ -23,9 +23,11 @@ class GatesNotesBridge extends BridgeAbstract
$cleanedContent = str_replace([
'<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">',
'</string>',
'\r\n',
], '', $rawContent);
$cleanedContent = str_replace('\"', '"', $cleanedContent);
$cleanedContent = trim($cleanedContent, '"');
// The content is actually a json between quotes with \r\n inserted
$json = Json::decode($cleanedContent, false);
foreach ($json as $article) {
@@ -98,7 +100,7 @@ class GatesNotesBridge extends BridgeAbstract
}
$article_body = sanitize($article_body->innertext);
$content = $top_description . $hero_image . $article_body;
$content = $top_description . ($hero_image ?? '') . $article_body;
return $content;
}