add check to prevent user creation with an id with trailing spaces

This commit is contained in:
alejandro-campos 2020-01-10 13:24:00 +01:00
parent d16ecc54b6
commit ec6a763aa2

View File

@ -243,6 +243,12 @@ if ($create_user) {
$password_new = '';
$password_confirm = '';
$new_user = true;
} else if (preg_match('/\s+$/', io_safe_output($id))) {
ui_print_error_message(__('Invalid user ID: trailing blank spaces not allowed'));
$user_info = $values;
$password_new = '';
$password_confirm = '';
$new_user = true;
} else if ($password_new == '') {
ui_print_error_message(__('Passwords cannot be empty'));
$user_info = $values;