From 95c9a59efa446ccfefe722ecb8aecb7c1ee553de Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 29 Aug 2024 11:17:45 +0200 Subject: [PATCH] Fix issue in RSS feed for notifications The first element in the array did not necessarily have the index `0`. --- .../files/lib/page/NotificationRssFeedPage.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/page/NotificationRssFeedPage.class.php b/wcfsetup/install/files/lib/page/NotificationRssFeedPage.class.php index f2ff35b4aa..e29f856e52 100644 --- a/wcfsetup/install/files/lib/page/NotificationRssFeedPage.class.php +++ b/wcfsetup/install/files/lib/page/NotificationRssFeedPage.class.php @@ -38,14 +38,16 @@ class NotificationRssFeedPage extends AbstractRssFeedPage $feed->channel($channel); $notifications = UserNotificationHandler::getInstance()->getNotifications(20); - if ($notifications['notifications'] !== []) { - $channel->lastBuildDateFromTimestamp($notifications['notifications'][0]['time']); - } - + $isFirstEntry = true; foreach ($notifications['notifications'] as $notification) { $event = $notification['event']; \assert($event instanceof AbstractUserNotificationEvent); + if ($isFirstEntry) { + $channel->lastBuildDateFromTimestamp($event->getTime()); + $isFirstEntry = false; + } + $item = new RssFeedItem(); $item ->title($event->getTitle()) -- 2.20.1