From: Roeland Jago Douma Date: Wed, 29 Nov 2017 14:24:08 +0000 (+0100) Subject: CardDAV convertor check should not be to wide X-Git-Tag: v12.0.5RC1~28^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dfed58e947c07ea075078aa84956a363357704ea;p=nextcloud-server.git CardDAV convertor check should not be to wide Case: email is set to null, but the avatar is set. In the old case the email would set $emptyValue but $noImage would still be false. This we would set the empty string as email. Signed-off-by: Roeland Jago Douma --- diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php index 9e106a0fe28..fb2813fb22c 100644 --- a/apps/dav/lib/CardDAV/Converter.php +++ b/apps/dav/lib/CardDAV/Converter.php @@ -60,6 +60,10 @@ class Converter { $publish = false; + if ($image !== null && isset($userData[AccountManager::PROPERTY_AVATAR])) { + $userData[AccountManager::PROPERTY_AVATAR]['value'] = true; + } + foreach ($userData as $property => $value) { $shareWithTrustedServers = @@ -67,9 +71,8 @@ class Converter { $value['scope'] === AccountManager::VISIBILITY_PUBLIC; $emptyValue = !isset($value['value']) || $value['value'] === ''; - $noImage = $image === null; - if ($shareWithTrustedServers && (!$emptyValue || !$noImage)) { + if ($shareWithTrustedServers && !$emptyValue) { $publish = true; switch ($property) { case AccountManager::PROPERTY_DISPLAYNAME: