Fixes build - removes .net 4.5 reference of EmailAddressAttribute - we'll leave that in for v7 when targettng 4.5

This commit is contained in:
Shannon
2013-10-11 10:58:31 +11:00
parent 63a4e00f52
commit 13dcfbbd2b

View File

@@ -750,9 +750,11 @@ namespace Umbraco.Web.Security.Providers
private bool IsEmaiValid(string email)
{
var validator = new EmailAddressAttribute();
return validator.IsValid(email);
const string pattern = @"^(?!\.)(""([^""\r\\]|\\[""\r\\])*""|"
+ @"([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?<!\.)\.)*)(?<!\.)"
+ @"@[a-z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$";
return Regex.IsMatch(email, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
}
/// <summary>