From 91b8e4196e76e09f09cae3832c18e9e372037fc7 Mon Sep 17 00:00:00 2001 From: Stelfux <22601105+StelFux@users.noreply.github.com> Date: Sat, 26 Mar 2022 19:09:27 +0100 Subject: [PATCH] [FeedExpander.php] Preserve original icon (#2145) --- lib/FeedExpander.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php index 86692644..841f5bf2 100644 --- a/lib/FeedExpander.php +++ b/lib/FeedExpander.php @@ -57,6 +57,12 @@ abstract class FeedExpander extends BridgeAbstract { */ private $uri; + /** + * Holds the icon of the feed + * + */ + private $icon; + /** * Holds the feed type during internal operations. * @@ -216,6 +222,10 @@ abstract class FeedExpander extends BridgeAbstract { protected function load_RSS_2_0_feed_data($rssContent){ $this->title = trim((string)$rssContent->title); $this->uri = trim((string)$rssContent->link); + + if (!empty($rssContent->image)) { + $this->icon = trim((string)$rssContent->image->url); + } } /** @@ -241,6 +251,12 @@ abstract class FeedExpander extends BridgeAbstract { } } } + + if(!empty($content->icon)) { + $this->icon = (string)$content->icon; + } elseif(!empty($content->logo)) { + $this->icon = (string)$content->logo; + } } /**