summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-01-20 22:04:56 +0100
committerGitHub <noreply@github.com>2020-01-20 22:04:56 +0100
commit46d89d6a4ef66228d7852400113e85b15117b779 (patch)
tree9b8a39beeebf91f215bcc794fc6636daeb8d6a52
parent997548cad22b689ce76951d1b4f0482eb6dd9098 (diff)
parent5e1e80fc40687f2c998400af41ff5257e3f7c7a0 (diff)
downloadnextcloud-server-46d89d6a4ef66228d7852400113e85b15117b779.tar.gz
nextcloud-server-46d89d6a4ef66228d7852400113e85b15117b779.zip
Merge pull request #18880 from nextcloud/backport/18115/stable17
[stable17] Properly handle resources in ReminderService
-rw-r--r--apps/dav/lib/CalDAV/Reminder/ReminderService.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
index dd19c400720..b163c2ad4b6 100644
--- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php
+++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
@@ -107,7 +107,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;
@@ -176,8 +180,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;
}