Skip to content

Commit 075e0de

Browse files
committed
- 0.2.1, found bug with email validator
1 parent e733d28 commit 075e0de

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.ansill.validation</groupId>
88
<artifactId>validation</artifactId>
9-
<version>0.2.0</version>
9+
<version>0.2.1</version>
1010
<!-- mvn versions:set -DnewVersion=your version -->
1111

1212
<packaging>jar</packaging>

src/main/java/com/ansill/validation/Validation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ private static String innerAssertValidEmailAddress(@Nullable String email_addres
257257
email_address = innerAssertNonnull(email_address, variable_name, 1);
258258

259259
// Exit if valid
260-
if (VALID_EMAIL_REGEX.matcher(email_address).matches()) return email_address;
260+
if(VALID_EMAIL_REGEX.matcher(email_address.toLowerCase()).matches()) return email_address;
261261

262262
// Otherwise go ahead and throw exception
263263
String message = composeMessage(variable_name, INVALID_EMAIL_MESSAGE);

src/test/java/com/ansill/validation/TestValues.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ public class TestValues{
2323

2424
public static final HashSet<String> VALID_EMAIL_ADDRESSES = new HashSet<>(Arrays.asList(
2525
"email@example.com",
26-
"firstname.lastname@example.com",
26+
"firsStname.lastname@example.com",
27+
"firstn123ame.lastname@example.com",
28+
"f7L6G@fake.com",
2729
"email@subdomain.example.com",
2830
"firstname+lastname@example.com",
2931
"email@123.123.123.123",

0 commit comments

Comments
 (0)