From 049941ee190d83d3975aa883e6e7dc88c34be736 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 4 Sep 2013 17:35:50 +0200 Subject: Unset mapped attachments list to avoid being written to cache --- lib/Kolab/CalDAV/CalendarBackend.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php index c151940..4b4a3c1 100644 --- a/lib/Kolab/CalDAV/CalendarBackend.php +++ b/lib/Kolab/CalDAV/CalendarBackend.php @@ -284,7 +284,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend $events[] = array( 'id' => $event['uid'], 'uri' => $event['uid'] . '.ics', - 'lastmodified' => $event['changed']->format('U'), + 'lastmodified' => $event['changed'] ? $event['changed']->format('U') : null, 'calendarid' => $calendarId, 'etag' => self::_get_etag($event), 'size' => $event['_size'], @@ -396,6 +396,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend // map attachments attribute $object['_attachments'] = $object['attachments']; + unset($object['attachments']); $success = $storage->save($object, $object['_type']); if (!$success) { @@ -466,6 +467,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend // process attachments if (/* user agent known to handle attachments inline */ !empty($object['attachments'])) { $object['_attachments'] = $object['attachments']; + unset($object['attachments']); // mark all existing attachments as deleted (update is always absolute) foreach ($old['_attachments'] as $key => $attach) { -- cgit v0.12