mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-26 04:05:45 +02:00
refactor: more feed parsing tweaks (#3748)
This commit is contained in:
parent
2880524dfc
commit
49d9dafaec
3 changed files with 20 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue