From: Marcel Werk Date: Thu, 29 Aug 2024 09:17:45 +0000 (+0200) Subject: Fix issue in RSS feed for notifications X-Git-Tag: 6.1.0_Beta_1~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=95c9a59efa446ccfefe722ecb8aecb7c1ee553de;p=GitHub%2FWoltLab%2FWCF.git Fix issue in RSS feed for notifications The first element in the array did not necessarily have the index `0`. --- 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())