N°4142 - Fix UserRights::GetUserPictureAbsUrl() returning user's placeholder picture for users with an unknown login

This commit is contained in:
Molkobain
2021-07-15 17:33:38 +02:00
parent 4e58b8616a
commit 4843545171

View File

@@ -1110,13 +1110,15 @@ class UserRights
}
}
}
} // If no contact, check if user has a placeholder in they preferences
else {
}
// If no contact & empty login, check if current user has a placeholder in they preferences
elseif ('' === $sLogin) {
$sPlaceholderPictureFilename = appUserPreferences::GetPref($sUserPicturePlaceholderPrefKey, null, static::GetUserId($sLogin));
if (!empty($sPlaceholderPictureFilename)) {
$sPictureUrl = utils::GetAbsoluteUrlAppRoot().$sUserPicturesFolder.$sPlaceholderPictureFilename;
}
}
// Else, no contact and no login, then it's for an unknown origin (system, extension, ...)
// Update cache
static::$m_aCacheContactPictureAbsUrl[$sLogin] = $sPictureUrl;