1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-31 22:00:23 +02:00

refactor: more feed parsing tweaks (#3748)

This commit is contained in:
Dag
2023-10-13 02:31:09 +02:00
committed by GitHub
parent 2880524dfc
commit 49d9dafaec
3 changed files with 20 additions and 7 deletions

View File

@@ -22,6 +22,11 @@ abstract class FeedExpander extends BridgeAbstract
if ($xmlString === '') {
throw new \Exception(sprintf('Unable to parse xml from `%s` because we got the empty string', $url), 10);
}
// prepare/massage the xml to make it more acceptable
$badStrings = [
'»',
];
$xmlString = str_replace($badStrings, '', $xmlString);
$feedParser = new FeedParser();
$this->feed = $feedParser->parseFeed($xmlString);
$items = array_slice($this->feed['items'], 0, $maxItems);