summaryrefslogtreecommitdiff
path: root/plugins/calendar
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-26 14:24:22 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-26 14:24:22 (GMT)
commitc19bd982334f123d003bab826238548d57b11c84 (patch)
treeb5ebd50d20eb817a8964a1c82f3f6ee96a11c9a3 /plugins/calendar
parent899646afd824cc9a57cba6f5c9a4971eab395d07 (diff)
downloadroundcubemail-plugins-kolab-c19bd982334f123d003bab826238548d57b11c84.tar.gz
Fix attachment retrieval with direct instance identifiers (#4722)
Diffstat (limited to 'plugins/calendar')
-rw-r--r--plugins/calendar/drivers/kolab/kolab_calendar.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_calendar.php b/plugins/calendar/drivers/kolab/kolab_calendar.php
index bfdaf7b..6458d05 100644
--- a/plugins/calendar/drivers/kolab/kolab_calendar.php
+++ b/plugins/calendar/drivers/kolab/kolab_calendar.php
@@ -221,7 +221,20 @@ class kolab_calendar extends kolab_storage_folder_api
*/
public function get_attachment_body($id, $event)
{
- return $this->ready ? $this->storage->get_attachment($event['id'], $id): false;
+ if (!$this->ready)
+ return false;
+
+ $data = $this->storage->get_attachment($event['id'], $id);
+
+ if ($data == null) {
+ // try again with master UID
+ $uid = preg_replace('/-\d+(T\d{6})?$/', '', $event['id']);
+ if ($uid != $event['id']) {
+ $data = $this->storage->get_attachment($uid, $id);
+ }
+ }
+
+ return $data;
}
/**