diff --git a/src/Core/Utilities/StrictEmailAddressAttribute.cs b/src/Core/Utilities/StrictEmailAddressAttribute.cs index cb0ab8969a..15347ab836 100644 --- a/src/Core/Utilities/StrictEmailAddressAttribute.cs +++ b/src/Core/Utilities/StrictEmailAddressAttribute.cs @@ -41,7 +41,7 @@ namespace Bit.Core.Utilities * Must end in a letter (including unicode) See the unit tests for examples of what is allowed. **/ - var emailFormat = @"[\x00-\x7F]+@.+\.\p{L}+$"; + var emailFormat = @"^[\x00-\x7F]+@.+\.\p{L}+$"; if (!Regex.IsMatch(emailAddress, emailFormat)) { return false; diff --git a/test/Core.Test/Utilities/StrictEmailAddressAttributeTests.cs b/test/Core.Test/Utilities/StrictEmailAddressAttributeTests.cs index 8a2909730a..6fac595621 100644 --- a/test/Core.Test/Utilities/StrictEmailAddressAttributeTests.cs +++ b/test/Core.Test/Utilities/StrictEmailAddressAttributeTests.cs @@ -45,7 +45,8 @@ namespace Bit.Core.Test.Utilities [InlineData("hellothere@.worldcom")] // domain beginning with dot [InlineData("hellothere@worldcom.")] // domain ending in dot [InlineData("hellothere@world.com-")] // domain ending in hyphen - [InlineData("héllö@world.com")] // unicode in local-part + [InlineData("hellö@world.com")] // unicode at end of local-part + [InlineData("héllo@world.com")] // unicode in middle of local-part public void IsValid_ReturnsFalseWhenInvalid(string email) { var sut = new StrictEmailAddressAttribute();