aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-11-29 15:24:08 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-12-11 11:58:02 +0100
commit40633c5e546f7145f084ed73d894f2c5246f3428 (patch)
treedbcc2b791cb50f818901ac24a2e0a80719d6a54a /apps
parent8ed728c1a2126ac11207c498ce6935ef307b3982 (diff)
downloadnextcloud-server-40633c5e546f7145f084ed73d894f2c5246f3428.tar.gz
nextcloud-server-40633c5e546f7145f084ed73d894f2c5246f3428.zip
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 <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CardDAV/Converter.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php
index c3f27c0299e..a480f0ea45d 100644
--- a/apps/dav/lib/CardDAV/Converter.php
+++ b/apps/dav/lib/CardDAV/Converter.php
@@ -61,6 +61,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 =
@@ -68,9 +72,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: