Skip to content

Commit

Permalink
fix(FeedParser): dont emit content module (RSS-Bridge#4180)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan authored and NotsoanoNimus committed Aug 8, 2024
1 parent 6a613a7 commit 78e6a76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 0 additions & 3 deletions lib/FeedItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ public function setContent($content)
|| $content instanceof simple_html_dom_node
) {
$content = (string) $content;
} elseif (is_array($content)) {
// Assuming this is the rss2.0 content module
$content = $content['encoded'] ?? '';
}

if (is_string($content)) {
Expand Down
7 changes: 6 additions & 1 deletion lib/FeedParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,13 @@ public function parseRss2Item(\SimpleXMLElement $feedItem): array
$media = $feedItem->children($namespaces['media']);
}

if (isset($namespaces['content'])) {
$content = $feedItem->children($namespaces['content']);
$item['content'] = (string) $content;
}

foreach ($namespaces as $namespaceName => $namespaceUrl) {
if (in_array($namespaceName, ['', 'media'])) {
if (in_array($namespaceName, ['', 'content', 'media'])) {
continue;
}
$item[$namespaceName] = $this->parseModule($feedItem, $namespaceName, $namespaceUrl);
Expand Down

0 comments on commit 78e6a76

Please sign in to comment.