From 615c5335878be434a9051278126f7286e1549e14 Mon Sep 17 00:00:00 2001 From: Dag Date: Wed, 31 Jul 2024 20:34:33 +0200 Subject: [PATCH] fix(FeedParser): dont emit content module (#4180) --- lib/FeedItem.php | 3 --- lib/FeedParser.php | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/FeedItem.php b/lib/FeedItem.php index dfb954a0929..09aab129941 100644 --- a/lib/FeedItem.php +++ b/lib/FeedItem.php @@ -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)) { diff --git a/lib/FeedParser.php b/lib/FeedParser.php index 3a2f15d4181..0ad90965b0b 100644 --- a/lib/FeedParser.php +++ b/lib/FeedParser.php @@ -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);