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>
$publish = false;
+ if ($image !== null && isset($userData[AccountManager::PROPERTY_AVATAR])) {
+ $userData[AccountManager::PROPERTY_AVATAR]['value'] = true;
+ }
+
foreach ($userData as $property => $value) {
$shareWithTrustedServers =
$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: