aboutsummaryrefslogtreecommitdiff
path: root/lib/FeedExpander.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2023-10-13 02:31:09 +0200
committerGravatar GitHub <noreply@github.com> 2023-10-13 02:31:09 +0200
commit49d9dafaecdb1e63ba1fe966f0e73c7f228fa5c3 (patch)
tree1c0d7fb18be8a2ac3d4a0086b8a007d3e74b799a /lib/FeedExpander.php
parent2880524dfc7685985fde8429c1dcb85387f4ba14 (diff)
downloadrss-bridge-49d9dafaecdb1e63ba1fe966f0e73c7f228fa5c3.tar.gz
rss-bridge-49d9dafaecdb1e63ba1fe966f0e73c7f228fa5c3.tar.zst
rss-bridge-49d9dafaecdb1e63ba1fe966f0e73c7f228fa5c3.zip
refactor: more feed parsing tweaks (#3748)
Diffstat (limited to 'lib/FeedExpander.php')
-rw-r--r--lib/FeedExpander.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php
index f9cff900..361df4d9 100644
--- a/lib/FeedExpander.php
+++ b/lib/FeedExpander.php
@@ -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 = [
+ '&raquo;',
+ ];
+ $xmlString = str_replace($badStrings, '', $xmlString);
$feedParser = new FeedParser();
$this->feed = $feedParser->parseFeed($xmlString);
$items = array_slice($this->feed['items'], 0, $maxItems);