From 69790c7527da4b65eb85b2f161fa7a8e6292d684 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 25 Apr 2017 15:41:16 -0600 Subject: [PATCH] Addressbook - Fix scheduled export of vcard caused 2 files with the same name in vfs --- addressbook/inc/class.addressbook_export_vcard.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addressbook/inc/class.addressbook_export_vcard.inc.php b/addressbook/inc/class.addressbook_export_vcard.inc.php index 2a578830c3..471e8b20f2 100644 --- a/addressbook/inc/class.addressbook_export_vcard.inc.php +++ b/addressbook/inc/class.addressbook_export_vcard.inc.php @@ -72,11 +72,13 @@ class addressbook_export_vcard implements importexport_iface_export_plugin { } } - // vCard opens & closes the resource itself, but this doesn't seem to matter - $meta = stream_get_meta_data($_stream); + // vCard opens & closes the file itself, so we can't just pass in the stream + $fp = tempnam($GLOBALS['egw_info']['server']['temp_dir'], 'egw'); $vcard = new addressbook_vcal('addressbook','text/vcard'); - $vcard->export($this->selection, $meta['uri']); + $vcard->export($this->selection, $fp); + + fwrite($_stream, file_get_contents($fp)); } /**