Permalink
Browse files

Don't output empty properties for CardDav requests. Bug: 12782

  • Loading branch information...
mrubinsk committed Jan 27, 2014
1 parent 5e9026d commit 4840a591ea959d2775640a7e16ee113209aac50c
Showing with 3 additions and 3 deletions.
  1. +3 −3 turba/lib/Api.php
@@ -356,7 +356,7 @@ public function browse($path = '',
}
if (in_array('contentlength', $properties)) {
try {
$data = $this->export($contact->getValue('__uid'), 'text/x-vcard', $contact->getSource());
$data = $this->export($contact->getValue('__uid'), 'text/x-vcard', $contact->getSource(), null, array('skip_empty' => true));
} catch (Turba_Exception $e) {
$data = '';
}
@@ -387,7 +387,7 @@ public function browse($path = '',
$contact = $driver->getObject($parts[2]);
$result = array(
'data' => $this->export($contact->getValue('__uid'), 'text/x-vcard', $contact->getSource()),
'data' => $this->export($contact->getValue('__uid'), 'text/x-vcard', $contact->getSource(), null, array('skip_empty' => true)),
'mimetype' => 'text/x-vcard'
);
$modified = $this->_modified($contact->getValue('__uid'), $parts[1]);
@@ -818,7 +818,7 @@ public function export($uid, $contentType, $sources = null, $fields = null, arra
case 'text/directory':
$export = '';
foreach ($result->objects as $obj) {
$vcard = $sdriver->tovCard($obj, $version, $fields);
$vcard = $sdriver->tovCard($obj, $version, $fields, !empty($options['skip_empty']));
/* vCards are not enclosed in
* BEGIN:VCALENDAR..END:VCALENDAR. Export the individual
* cards instead. */

0 comments on commit 4840a59

Please sign in to comment.