Merge branch 'ent-5231-9298-Bug-al-crear-un-usuario-con-espacios-al-final' into 'develop'

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

See merge request artica/pandorafms!3008
This commit is contained in:
Daniel Rodriguez 2020-01-10 14:41:33 +01:00
commit 50e533e559
1 changed files with 6 additions and 0 deletions

View File

@ -243,6 +243,12 @@ if ($create_user) {
$password_new = '';
$password_confirm = '';
$new_user = true;
} else if (preg_match('/^\s+|\s+$/', io_safe_output($id))) {
ui_print_error_message(__('Invalid user ID: leading or 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;