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 11using System . Collections . Generic ;
22using System . ComponentModel . DataAnnotations ;
3- using System . Text . RegularExpressions ;
43using Abp . Auditing ;
54using Abp . Authorization . Users ;
65using Abp . Extensions ;
6+ using AbpCompanyName . AbpProjectName . Validation ;
77
88namespace AbpCompanyName . AbpProjectName . Web . Models . Account
99{
@@ -37,8 +37,7 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
3737 {
3838 if ( ! UserName . IsNullOrEmpty ( ) )
3939 {
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 ) )
4241 {
4342 yield return new ValidationResult ( "Username cannot be an email address unless it's the same as your email address!" ) ;
4443 }
You can’t perform that action at this time.
0 commit comments