Restrict email local part to safe characters only
Remove backtick, curly braces, pipe, and slash from allowed characters. Keep underscore as it's commonly used and widely supported.
This commit is contained in:
parent
da037e9a79
commit
6b0e91798f
1 changed files with 1 additions and 1 deletions
|
|
@ -286,7 +286,7 @@ func (h *UserHandler) ListAll(c *gin.Context) {
|
|||
Success(c, users)
|
||||
}
|
||||
|
||||
var emailLocalPartRegex = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+\\-/=?^`{|}~-]+$")
|
||||
var emailLocalPartRegex = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+\\-=?^_~-]+$")
|
||||
|
||||
func validateEmailLocalPart(email string) error {
|
||||
parts := strings.Split(email, "@")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue