Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
validateEmail incorrectly tests results of std.net.isemail.isEmail() #1580
vibe.utils.validation.validateEmail tests the results of std.net.isemail.isEmail like this:
However, isEmail returns EmailStatus, not EmailStatusCode. Incidentally, EmailStatus aliases self to a bool property valid(), which allows the code above to compile. But the logic is reversed, since EmailStatusCode.valid == 0, although isEmail(str) == false when the e-mail is invalid.
Even though isEmail() (incorrectly) returned an invalid status, vibe treats it as valid.
Vice-versa, isEmail() now correctly returns a valid status, but vibe treats it as invalid.