Skip to content
Snippets Groups Projects
Commit 86c68a2a authored by Francé Wilke's avatar Francé Wilke
Browse files

Cater for ZWSP characters in ValidateEmailAddress

parent 01aa3128
Branches
Tags v1.196.0
No related merge requests found
......@@ -62,6 +62,9 @@ func ValidateEmailAddress(email string) (string, error) {
cleanEmail := strings.ToLower(strings.TrimSpace(email))
cleanEmail = string_utils.RemoveAllWhiteSpaces(cleanEmail)
// Remove ZWSP ("\u200B") characters with an empty string to remove it
cleanEmail = strings.ReplaceAll(cleanEmail, "\u200B", "")
// We validate it but still return it since in some cases we don't want to break everything if the email is bad
_, err := mail.ParseAddress(cleanEmail)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment