From 67f5b32d89c7a28bd5254cedc4b241568d1c68fa Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+github@gmail.com>
Date: Mon, 4 Apr 2022 10:25:39 +0200
Subject: [PATCH] trim user attributes when creating users, fixes #865

---
 app/controllers/admin/user.php | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/controllers/admin/user.php b/app/controllers/admin/user.php
index 331722624ba..d1b7860975e 100644
--- a/app/controllers/admin/user.php
+++ b/app/controllers/admin/user.php
@@ -649,15 +649,15 @@ class Admin_UserController extends AuthenticatedController
 
         //get formdata
         $this->user = [
-            'username'    => Request::get('username'),
+            'username'    => trim(Request::get('username')),
             'perm'        => Request::option('perm'),
             'visible'     => Request::get('visible'),
-            'Vorname'     => Request::get('Vorname'),
-            'Nachname'    => Request::get('Nachname'),
+            'Vorname'     => trim(Request::get('Vorname')),
+            'Nachname'    => trim(Request::get('Nachname')),
             'geschlecht'  => Request::int('geschlecht'),
-            'title_front' => Request::get('title_front'),
-            'title_rear'  => Request::get('title_rear'),
-            'Email'       => Request::get('Email'),
+            'title_front' => trim(Request::get('title_front')),
+            'title_rear'  => trim(Request::get('title_rear')),
+            'Email'       => trim(Request::get('Email')),
             'auth_plugin' => Request::get('auth_plugin'),
             'institute'   => Request::option('institute'),
             'preferred_language' => Request::get('preferred_language')
-- 
GitLab