Merge pull request #18115 from nextcloud/bugfix/17951/reminderservice_resource_error
Properly handle resources in ReminderService
This commit is contained in:
commit
b7f93cc56b
|
@ -112,7 +112,11 @@ class ReminderService {
|
||||||
$reminders = $this->backend->getRemindersToProcess();
|
$reminders = $this->backend->getRemindersToProcess();
|
||||||
|
|
||||||
foreach($reminders as $reminder) {
|
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) {
|
if (!$vcalendar) {
|
||||||
$this->backend->removeReminder($reminder['id']);
|
$this->backend->removeReminder($reminder['id']);
|
||||||
continue;
|
continue;
|
||||||
|
@ -181,8 +185,12 @@ class ReminderService {
|
||||||
* @param array $objectData
|
* @param array $objectData
|
||||||
*/
|
*/
|
||||||
private function onCalendarObjectCreate(array $objectData):void {
|
private function onCalendarObjectCreate(array $objectData):void {
|
||||||
|
$calendarData = is_resource($objectData['calendardata'])
|
||||||
|
? stream_get_contents($objectData['calendardata'])
|
||||||
|
: $objectData['calendardata'];
|
||||||
|
|
||||||
/** @var VObject\Component\VCalendar $vcalendar */
|
/** @var VObject\Component\VCalendar $vcalendar */
|
||||||
$vcalendar = $this->parseCalendarData($objectData['calendardata']);
|
$vcalendar = $this->parseCalendarData($calendarData);
|
||||||
if (!$vcalendar) {
|
if (!$vcalendar) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue