From 81e35d0c8a1bd8825b46b26c55dc94914e3e7c52 Mon Sep 17 00:00:00 2001 From: Christoph Wurst <christoph@winzerhof-wurst.at> Date: Wed, 27 Nov 2019 14:54:45 +0100 Subject: 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> --- core/Controller/LoginController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 5d5ae666ca1..e9e2f02edb2 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -289,7 +289,7 @@ class LoginController extends Controller { $data = new LoginData( $this->request, - $user, + trim($user), $password, $redirect_url, $timezone, -- cgit v1.2.3