From 20d2a17701695a6fe40b0e298aef9f9fd709ce5a Mon Sep 17 00:00:00 2001 From: angerangel Date: Mon, 21 Jun 2021 11:00:33 +0200 Subject: [PATCH] Change image tag to enclosure tag Many RSS feed readers prefer the **enclosue** tag instead of **image** tag. The enclosure tag is a generic tag for any type of media. I tried to make it most simple and universl possible. --- bl-plugins/rss/plugin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bl-plugins/rss/plugin.php b/bl-plugins/rss/plugin.php index c53e3dcc..d9d1316c 100644 --- a/bl-plugins/rss/plugin.php +++ b/bl-plugins/rss/plugin.php @@ -74,8 +74,10 @@ class pluginRSS extends Plugin { $page = new Page($pageKey); $xml .= ''; $xml .= ''.$page->title().''; - $xml .= ''.$this->encodeURL($page->permalink()).''; - $xml .= ''.$page->coverImage(true).''; + $xml .= ''.$this->encodeURL($page->permalink()).''; + $imagepath = parse_url($page->coverImage(true), PHP_URL_PATH); + $imagepath = $_SERVER['DOCUMENT_ROOT'] . $imagepath; + $xml .= ''; $xml .= ''.Sanitize::html($page->contentBreak()).''; $xml .= ''.date(DATE_RSS,strtotime($page->getValue('dateRaw'))).''; $xml .= ''.$page->uuid().'';