Email aus Kommentar entfernen

This commit is contained in:
2026-07-19 17:57:34 +02:00
parent 4f4ad9599d
commit 3a819d6ed2
2 changed files with 11 additions and 5 deletions
+5 -3
View File
@@ -15,15 +15,17 @@ $userManager = UserManager::getInstance();
*/
function getCommentAuthorName($email, $userManager)
{
$email = trim($email);
$user = $userManager->findUser($email);
if ($user === null) {
return $email;
}
$fullName = trim(
($user["vorname"] ?? "") . " " . ($user["nachname"] ?? "")
);
$vorname = trim($user["vorname"] ?? "");
$nachname = trim($user["nachname"] ?? "");
$fullName = trim($vorname . " " . $nachname);
return $fullName !== "" ? $fullName : $email;
}