Cannot invite user to project if email start with a number
Summary
Unable to invite user by email if the email start with number. When there's a leading number in the email field, invitation treat the number as User ID instead and ignore the other characters completely.
Steps to reproduce
- Go to a project member page
- Fill in the
GitLab member or Email address
field with and email starting with a number - See a different user whose ID was the same as the number on the email added to the project instead of actually inviting the email
What is the current bug behavior?
When there's a leading number in an email instead of treating the whole string as email, the invitation pick the leading number and treated it as UserID and ignore the email entirely.
What is the expected correct behavior?
Treat the whole field as string and send invitation email out to intended user.
Output of checks
This bug happens on GitLab.com; GitLab Enterprise Edition 12.9.0-pre 40f66435