aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-04-08 11:10:10 +0200
committerGravatar GitHub <noreply@github.com> 2024-04-08 11:10:10 +0200
commit283341e75e6ef4fbb3c522635b8a7805d3ab3a20 (patch)
treeb207210f38b6c3f3c90b4c0bf4c330ab61b0c078 /app/views
parentc052149e5aa6eccdafd70f1e85e56cc4dd57ed8b (diff)
Allow multiple authors on enclosures (#6272)
fix https://github.com/FreshRSS/FreshRSS/issues/5066
Diffstat (limited to 'app/views')
-rw-r--r--app/views/index/rss.phtml12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml
index 80768c5b7..c811a0354 100644
--- a/app/views/index/rss.phtml
+++ b/app/views/index/rss.phtml
@@ -60,6 +60,16 @@ foreach ($this->entries as $item) {
continue;
}
$urls[$enclosure['url']] = true;
+
+ $credits = $enclosure['credit'] ?? [];
+ if (!is_array($credits)) { // For entries < FreshRSS 1.24
+ $credits = [$credits];
+ }
+ $mediaCredits = '';
+ foreach ($credits as $credit) {
+ $mediaCredits = '<media:credit>' . $credit . '</media:credit>';
+ }
+
// https://www.rssboard.org/media-rss
echo "\t\t\t", '<media:content url="' . $enclosure['url']
. (empty($enclosure['medium']) ? '' : '" medium="' . $enclosure['medium'])
@@ -69,7 +79,7 @@ foreach ($this->entries as $item) {
. (empty($enclosure['width']) ? '' : '" width="' . $enclosure['width'])
. '">'
. (empty($enclosure['title']) ? '' : '<media:title type="html">' . $enclosure['title'] . '</media:title>')
- . (empty($enclosure['credit']) ? '' : '<media:credit>' . $enclosure['credit'] . '</media:credit>')
+ . $mediaCredits
. '</media:content>', "\n";
}
?>