Skip to content

Commit

Permalink
fix(FeedParser): dont emit content module (#4180)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan authored Jul 31, 2024
1 parent 8a1f260 commit 615c533
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 615c533

Please sign in to comment.