Skip to content

Commit

Permalink
Merge pull request #1544 from nextcloud/backport/1536/stable27
Browse files Browse the repository at this point in the history
[stable27] fix rss feed item guid
  • Loading branch information
susnux authored Feb 3, 2024
2 parents d79916b + 64171ec commit 3edcaa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<atom:link href="<?php p($_['rssLink']); ?>" rel="self" type="application/rss+xml" />
<?php foreach ($_['activities'] as $activity) { ?>
<item>
<guid isPermaLink="false"><?php p($activity['activity_id']); ?></guid>
<guid isPermaLink="false"><?php p($_['rssLink'] . '?id=' . $activity['activity_id']); ?></guid>
<?php if (!empty($activity['subject'])): ?>
<title><?php p(str_replace("\n", ' ', $activity['subject'])); ?></title>
<?php endif; ?>
Expand Down
6 changes: 3 additions & 3 deletions tests/Template/RssTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ public function dataContent(): array {
['activity_id' => 1337, 'subject' => '', 'link' => '', 'timestamp' => 0, 'message' => ''],
],
' <item>'
. "\n" . ' <guid isPermaLink="false">1337</guid>'
. "\n" . ' <guid isPermaLink="false">http://nextcloud.org?id=1337</guid>'
. "\n" . ' </item>',
],
[
[
['activity_id' => 42, 'subject' => 'text', 'link' => 'http://docs.nextcloud.org', 'timestamp' => 21, 'message' => 'text2'],
],
' <item>'
. "\n" . ' <guid isPermaLink="false">42</guid>'
. "\n" . ' <guid isPermaLink="false">http://nextcloud.org?id=42</guid>'
. "\n" . ' <title>text</title>'
. "\n" . ' <link>http://docs.nextcloud.org</link>'
. "\n" . ' <pubDate>Thu, 01 Jan 1970 00:00:21 +0000</pubDate>'
Expand All @@ -97,7 +97,7 @@ public function dataContent(): array {
['activity_id' => 42, 'subject' => 'text', 'link' => 'http://docs.nextcloud.org', 'timestamp' => 21],
],
' <item>'
. "\n" . ' <guid isPermaLink="false">42</guid>'
. "\n" . ' <guid isPermaLink="false">http://nextcloud.org?id=42</guid>'
. "\n" . ' <title>text</title>'
. "\n" . ' <link>http://docs.nextcloud.org</link>'
. "\n" . ' <pubDate>Thu, 01 Jan 1970 00:00:21 +0000</pubDate>'
Expand Down

0 comments on commit 3edcaa9

Please sign in to comment.