File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Models/Account Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
2
using System . ComponentModel . DataAnnotations ;
3
- using System . Text . RegularExpressions ;
4
3
using Abp . Auditing ;
5
4
using Abp . Authorization . Users ;
6
5
using Abp . Extensions ;
6
+ using AbpCompanyName . AbpProjectName . Validation ;
7
7
8
8
namespace AbpCompanyName . AbpProjectName . Web . Models . Account
9
9
{
@@ -37,8 +37,7 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
37
37
{
38
38
if ( ! UserName . IsNullOrEmpty ( ) )
39
39
{
40
- var emailRegex = new Regex ( @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" ) ;
41
- if ( ! UserName . Equals ( EmailAddress ) && emailRegex . IsMatch ( UserName ) )
40
+ if ( ! UserName . Equals ( EmailAddress ) && ValidationHelper . IsEmail ( UserName ) )
42
41
{
43
42
yield return new ValidationResult ( "Username cannot be an email address unless it's the same as your email address!" ) ;
44
43
}
You can’t perform that action at this time.
0 commit comments