struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject struts git commit: WW-4626 Adds support for .cat domain
Date Fri, 13 May 2016 05:40:35 GMT
Repository: struts
Updated Branches:
  refs/heads/support-2-3 f052398cd -> 9bcd1bc9f


WW-4626 Adds support for .cat domain


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9bcd1bc9
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9bcd1bc9
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9bcd1bc9

Branch: refs/heads/support-2-3
Commit: 9bcd1bc9f610c85117087dfb82f6e5f1424f14e7
Parents: f052398
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Fri May 13 07:40:25 2016 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Fri May 13 07:40:25 2016 +0200

----------------------------------------------------------------------
 .../opensymphony/xwork2/validator/validators/EmailValidator.java | 4 ++--
 .../com/opensymphony/xwork2/validator/EmailValidatorTest.java    | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/9bcd1bc9/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/EmailValidator.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/EmailValidator.java
b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/EmailValidator.java
index d54a1fa..9410eb6 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/EmailValidator.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/EmailValidator.java
@@ -23,7 +23,7 @@ package com.opensymphony.xwork2.validator.validators;
  * The regular expression used to validate that the string is an email address is:
  *
  * <pre>
- * \\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx)$\\b
+ * \\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|tech|cat)$\\b
  * </pre>
  *
  * You can also specify expression, caseSensitive and trim params as a OGNL expression, see
the example below.
@@ -80,7 +80,7 @@ public class EmailValidator extends RegexFieldValidator {
 
 	// see XW-371 
     public static final String EMAIL_ADDRESS_PATTERN =
-    	"\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|tech)$\\b";
+    	"\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|tech|cat)$\\b";
 
     public EmailValidator() {
         setRegex(EMAIL_ADDRESS_PATTERN);

http://git-wip-us.apache.org/repos/asf/struts/blob/9bcd1bc9/xwork-core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
b/xwork-core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
index ca9a549..0dd4298 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/validator/EmailValidatorTest.java
@@ -44,6 +44,7 @@ public class EmailValidatorTest extends XWorkTestCase {
         assertTrue(verifyEmailValidity("tmj'ee@yahoo.com"));
         assertTrue(verifyEmailValidity("ferda+mravenec@yahoo.com"));
         assertTrue(verifyEmailValidity("Ferda+Mravenec@yaHoo.CoM"));
+        assertTrue(verifyEmailValidity("Ferda+Mravenec@yaHoo.cat"));
 
         assertFalse(verifyEmailValidity("tm_jee#marry@yahoo.co.uk"));
         assertFalse(verifyEmailValidity("tm_jee@ yahoo.co.uk"));


Mime
View raw message