You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "orionlibs (via GitHub)" <gi...@apache.org> on 2023/07/16 00:36:56 UTC

[GitHub] [commons-validator] orionlibs opened a new pull request, #140: VALIDATOR-368: allowed angle brackets in email addresses

orionlibs opened a new pull request, #140:
URL: https://github.com/apache/commons-validator/pull/140

   [VALIDATOR-368](https://issues.apache.org/jira/browse/VALIDATOR-368): allowed angle brackets in email addresses


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] VALIDATOR-368: allowed angle brackets in email addresses [commons-validator]

Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #140:
URL: https://github.com/apache/commons-validator/pull/140#discussion_r1372807236


##########
src/main/java/org/apache/commons/validator/routines/EmailValidator.java:
##########
@@ -179,15 +182,28 @@ public boolean isValid(final String email) {
 
         // Check the whole email address structure
         final Matcher emailMatcher = EMAIL_PATTERN.matcher(email);
-        if (!emailMatcher.matches()) {
+        final Matcher fullnameEmailMatcher = EMAIL_WITH_FULL_NAME_PATTERN.matcher(email);
+        final boolean fullnameEmailMatches = fullnameEmailMatcher.matches();

Review Comment:
   Not sure you need to keep this variable



##########
src/main/java/org/apache/commons/validator/routines/EmailValidator.java:
##########
@@ -41,11 +41,14 @@ public class EmailValidator implements Serializable {
     private static final String QUOTED_USER = "(\"(\\\\\"|[^\"])*\")";
     private static final String WORD = "((" + VALID_CHARS + "|')+|" + QUOTED_USER + ")";
 
-    private static final String EMAIL_REGEX = "^(.+)@(\\S+)$";
+    private static final String EMAIL_CHARACTERS = "(.+)@(\\S+)";
+    private static final String EMAIL_REGEX = "^" + EMAIL_CHARACTERS + "$";
     private static final String IP_DOMAIN_REGEX = "^\\[(.*)\\]$";
     private static final String USER_REGEX = "^" + WORD + "(\\." + WORD + ")*$";
+    private static final String FULL_NAME_EMAIL_REGEX = "^(.+)<" + EMAIL_CHARACTERS + ">$";

Review Comment:
   Why capture the leading comment?
   It is not needed.



##########
src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java:
##########
@@ -407,6 +407,8 @@ public void testEmailUserName()  {
         assertFalse(validator.isValid("Abc@def@example.com"));
 
         assertTrue(validator.isValid("space\\ monkey@example.com"));
+
+        assertTrue(validator.isValid("Abigail Jones <ab...@example.com>"));

Review Comment:
   Need some tests to show that user part and domain part are properly validated



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] VALIDATOR-368: allowed angle brackets in email addresses [commons-validator]

Posted by "orionlibs (via GitHub)" <gi...@apache.org>.
orionlibs commented on PR #140:
URL: https://github.com/apache/commons-validator/pull/140#issuecomment-1837483025

   this PR has been open for half a year


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] VALIDATOR-368: allowed angle brackets in email addresses [commons-validator]

Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #140:
URL: https://github.com/apache/commons-validator/pull/140#issuecomment-1837484615

   There are some review comments that need to be addressed before it can be considered for inclusion in the code base.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] VALIDATOR-368: allowed angle brackets in email addresses [commons-validator]

Posted by "Lonzak (via GitHub)" <gi...@apache.org>.
Lonzak commented on PR #140:
URL: https://github.com/apache/commons-validator/pull/140#issuecomment-1838053740

   We should really find a solution for this - constructor parameter || lenient matcher I don't mind. Any solution helps


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] VALIDATOR-368: allowed angle brackets in email addresses [commons-validator]

Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #140:
URL: https://github.com/apache/commons-validator/pull/140#issuecomment-1839125737

   Contributions are still welcome.
   However the new behaviour needs to be optional, and there need to be some tests.
   
   It does not look to be particularly difficult, but someone has to do the work...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] VALIDATOR-368: allowed angle brackets in email addresses [commons-validator]

Posted by "orionlibs (via GitHub)" <gi...@apache.org>.
orionlibs closed pull request #140: VALIDATOR-368: allowed angle brackets in email addresses
URL: https://github.com/apache/commons-validator/pull/140


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] VALIDATOR-368: allowed angle brackets in email addresses [commons-validator]

Posted by "nj1830 (via GitHub)" <gi...@apache.org>.
nj1830 commented on PR #140:
URL: https://github.com/apache/commons-validator/pull/140#issuecomment-1780587763

   Hi, any idea when this fix can be reviewed/merged?  thx


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-validator] garydgregory commented on pull request #140: VALIDATOR-368: allowed angle brackets in email addresses

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #140:
URL: https://github.com/apache/commons-validator/pull/140#issuecomment-1736028154

   I should be able to come back around to this component is a week or two. I am working on releasing Commons IO ATM...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-validator] orionlibs commented on pull request #140: VALIDATOR-368: allowed angle brackets in email addresses

Posted by "orionlibs (via GitHub)" <gi...@apache.org>.
orionlibs commented on PR #140:
URL: https://github.com/apache/commons-validator/pull/140#issuecomment-1735963733

   this PR was done 70 days ago. It awaits review and merge


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org