prevent user creation with leading or trailing spaces in user id

This commit is contained in:
alejandro-campos 2020-01-10 13:50:04 +01:00
parent ec6a763aa2
commit 78df8dcb95

View File

@ -243,8 +243,8 @@ if ($create_user) {
$password_new = ''; $password_new = '';
$password_confirm = ''; $password_confirm = '';
$new_user = true; $new_user = true;
} else if (preg_match('/\s+$/', io_safe_output($id))) { } else if (preg_match('/^\s+|\s+$/', io_safe_output($id))) {
ui_print_error_message(__('Invalid user ID: trailing blank spaces not allowed')); ui_print_error_message(__('Invalid user ID: leading or trailing blank spaces not allowed'));
$user_info = $values; $user_info = $values;
$password_new = ''; $password_new = '';
$password_confirm = ''; $password_confirm = '';