Always trim the username before saving changes in the database

Fixes #4742
This commit is contained in:
Frédéric Guillot
2023-02-12 18:17:23 -08:00
committed by Frédéric Guillot
parent 5f3225bddc
commit bd8bcfbc37
2 changed files with 13 additions and 0 deletions

View File

@@ -261,6 +261,10 @@ class UserModel extends Base
}
}
if (isset($values['username'])) {
$values['username'] = trim($values['username']);
}
$this->helper->model->removeFields($values, array('confirmation', 'current_password'));
$this->helper->model->resetFields($values, array('is_ldap_user', 'disable_login_form'));
$this->helper->model->convertNullFields($values, array('gitlab_id'));