Skip to content

Commit 81e35d0

Browse files
ChristophWurstrullzer
authored andcommitted
Trim the login name
Otherwise we keep on using it with leading or trailing whitespaces for app tokens and other logic. The reason this doesn't throw an error immediately with local users is that (My)SQL compares strings regardless of their padding by default. So we look up 'uid ' and get the row for the user 'uid'. Other back-ends will lead to a hard error, though, and the user is unable to log out as all request fail. Ref https://stackoverflow.com/a/10495807/2239067 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent 29bdaf7 commit 81e35d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/Controller/LoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function tryLogin(string $user,
289289

290290
$data = new LoginData(
291291
$this->request,
292-
$user,
292+
trim($user),
293293
$password,
294294
$redirect_url,
295295
$timezone,

0 commit comments

Comments
 (0)