Skip to content

Commit cc3271e

Browse files
tom93meisterT
authored andcommitted
Fix default full name in self-registration form
When the full name is not specified, the code is supposed to set it to the username. But that wasn't working because the code was checking for `null` but the full name is set to an empty string. Fix this by checking for either an empty string or `null` (casting `null` to string returns an empty string).
1 parent e8ddc5e commit cc3271e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webapp/src/Controller/SecurityController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function registerAction(
105105
$plainPass = $registration_form->get('plainPassword')->getData();
106106
$password = $passwordHasher->hashPassword($user, $plainPass);
107107
$user->setPassword($password);
108-
if ($user->getName() === null) {
108+
if ((string)$user->getName() === '') {
109109
$user->setName($user->getUsername());
110110
}
111111

0 commit comments

Comments
 (0)