From 05e47af6b2b04caf91d52e83783413e091b4d399 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 26 Nov 2019 12:20:35 +0100 Subject: [PATCH] Properly handle resources in ReminderService Signed-off-by: Georg Ehrke --- apps/dav/lib/CalDAV/Reminder/ReminderService.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index 3c815801c9..314c7a2b50 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -108,7 +108,11 @@ class ReminderService { $reminders = $this->backend->getRemindersToProcess(); foreach($reminders as $reminder) { - $vcalendar = $this->parseCalendarData($reminder['calendardata']); + $calendarData = is_resource($reminder['calendardata']) + ? stream_get_contents($reminder['calendardata']) + : $reminder['calendardata']; + + $vcalendar = $this->parseCalendarData($calendarData); if (!$vcalendar) { $this->backend->removeReminder($reminder['id']); continue; @@ -177,8 +181,12 @@ class ReminderService { * @param array $objectData */ private function onCalendarObjectCreate(array $objectData):void { + $calendarData = is_resource($objectData['calendardata']) + ? stream_get_contents($objectData['calendardata']) + : $objectData['calendardata']; + /** @var VObject\Component\VCalendar $vcalendar */ - $vcalendar = $this->parseCalendarData($objectData['calendardata']); + $vcalendar = $this->parseCalendarData($calendarData); if (!$vcalendar) { return; }