Skip to content

Commit

Permalink
Don't output empty properties for CardDav requests. Bug: 12782
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk authored and yunosh committed Mar 31, 2014
1 parent 51d86a0 commit 738ce25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions turba/lib/Api.php
Expand Up @@ -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 = '';
}
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -823,7 +823,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. */
Expand Down

0 comments on commit 738ce25

Please sign in to comment.