]> source.dussan.org Git - nextcloud-server.git/commitdiff
CardDAV convertor check should not be to wide 7456/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 29 Nov 2017 14:24:08 +0000 (15:24 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 11 Dec 2017 20:14:33 +0000 (21:14 +0100)
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 <roeland@famdouma.nl>
apps/dav/lib/CardDAV/Converter.php

index 9e106a0fe28cfb249e8b904b37589c74c59db7ef..fb2813fb22c3bb3e6add8096d5345d1c8707f185 100644 (file)
@@ -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: