RadzenEmailValidator can validate invalid email #691

Closed
opened 2026-01-29 17:41:38 +00:00 by claunia · 1 comment
Owner

Originally created by @marekm294 on GitHub (Jan 5, 2023).

Describe the bug
RadzenEmailValidator can validate invalid email. Example page(https://blazor.radzen.com/emailvalidator) validates "a@.cz" as a valid email. System.Net.Mail.MailAddress.TryParse() (and different google validators) doesn't validate it correctly.

To Reproduce
Steps to reproduce the behavior:
Visit https://blazor.radzen.com/emailvalidator and enter invalid email.

Expected behavior
Entered email should be invalid

Screenshots
image

Desktop (please complete the following information):
Used google chrome - 108.0.5359.125 (current version in time of creating this issue).

Originally created by @marekm294 on GitHub (Jan 5, 2023). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** RadzenEmailValidator can validate invalid email. Example page(https://blazor.radzen.com/emailvalidator) validates "a@.cz" as a valid email. System.Net.Mail.MailAddress.TryParse() (and different google validators) doesn't validate it correctly. **To Reproduce** Steps to reproduce the behavior: Visit https://blazor.radzen.com/emailvalidator and enter invalid email. **Expected behavior** Entered email should be invalid **Screenshots** ![image](https://user-images.githubusercontent.com/108216731/210812269-3844ae52-4f34-47ea-8271-1e709a5ccae5.png) **Desktop (please complete the following information):** Used google chrome - 108.0.5359.125 (current version in time of creating this issue).
Author
Owner

@akorchev commented on GitHub (Jan 5, 2023):

RadzenEmailValidator uses the EmailAddressAttribute provided by .NET. It seems that attribute thinks this address is valid.

@akorchev commented on GitHub (Jan 5, 2023): RadzenEmailValidator uses the [EmailAddressAttribute](https://referencesource.microsoft.com/#System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs) provided by .NET. It seems that attribute thinks this address is valid.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#691