summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-07-08 23:36:52 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-07-08 23:36:52 +0200
commit0b6cd8d2033cf280431436e76ca3847597f6f596 (patch)
tree8449587d96039a725ff7ce3aa0379a33209d3f9f
parentdc8193fccb7f18435844a3f5d2e79d27b6b7f0a3 (diff)
downloadnextcloud-server-0b6cd8d2033cf280431436e76ca3847597f6f596.tar.gz
nextcloud-server-0b6cd8d2033cf280431436e76ca3847597f6f596.zip
Simplify VCF generation.
-rw-r--r--apps/contacts/lib/VCFExportPlugin.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/contacts/lib/VCFExportPlugin.php b/apps/contacts/lib/VCFExportPlugin.php
index b1edcaaef2a..6554cb258e8 100644
--- a/apps/contacts/lib/VCFExportPlugin.php
+++ b/apps/contacts/lib/VCFExportPlugin.php
@@ -1,7 +1,7 @@
<?php
/**
- * ICS Exporter
+ * VCF Exporter
*
* This plugin adds the ability to export entire address books as .vcf files.
* This is useful for clients that don't support CardDAV yet. They often do
@@ -53,7 +53,7 @@ class Sabre_CardDAV_VCFExportPlugin extends Sabre_DAV_ServerPlugin {
$node = $this->server->tree->getNodeForPath($uri);
- if (!($node instanceof Sabre_CardDAV_AddressBook)) return;
+ if (!($node instanceof Sabre_CardDAV_IAddressBook)) return;
// Checking ACL, if available.
if ($aclPlugin = $this->server->getPlugin('acl')) {
@@ -89,14 +89,11 @@ class Sabre_CardDAV_VCFExportPlugin extends Sabre_DAV_ServerPlugin {
continue;
}
$nodeData = $node[200]['{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}address-data'];
-
- $nodeComp = Sabre_VObject_Reader::read($nodeData);
- $objects[] = $nodeComp;
+ $objects[] = $nodeData;
}
- ob_start();
- foreach($objects as $obj) echo $obj->serialize();
- return ob_get_clean();
+
+ return implode("\r\n", $objects);
}