Skip to content

Commit ed23db1

Browse files
committed
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 <[email protected]>
1 parent 6097b74 commit ed23db1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/dav/lib/CardDAV/Converter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,19 @@ public function createCardFromUser(IUser $user) {
6161

6262
$publish = false;
6363

64+
if ($image !== null && isset($userData[AccountManager::PROPERTY_AVATAR])) {
65+
$userData[AccountManager::PROPERTY_AVATAR]['value'] = true;
66+
}
67+
6468
foreach ($userData as $property => $value) {
6569

6670
$shareWithTrustedServers =
6771
$value['scope'] === AccountManager::VISIBILITY_CONTACTS_ONLY ||
6872
$value['scope'] === AccountManager::VISIBILITY_PUBLIC;
6973

7074
$emptyValue = !isset($value['value']) || $value['value'] === '';
71-
$noImage = $image === null;
7275

73-
if ($shareWithTrustedServers && (!$emptyValue || !$noImage)) {
76+
if ($shareWithTrustedServers && !$emptyValue) {
7477
$publish = true;
7578
switch ($property) {
7679
case AccountManager::PROPERTY_DISPLAYNAME:

0 commit comments

Comments
 (0)