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>
This commit is contained in:
Roeland Jago Douma 2017-11-29 15:24:08 +01:00 committed by Morris Jobke
parent 8ed728c1a2
commit 40633c5e54
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 5 additions and 2 deletions

View File

@ -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: