Skip to content

Commit

Permalink
Merge branch 'upper-case'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Nov 12, 2015
2 parents 7a06fe4 + fb896b6 commit c3ec2c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ END SNIPPET: supported-validators
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "email">
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("${validator.regex?js_string}")==null) {
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match(/${validator.regex}/i)==null) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "url">
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("/${validator.urlRegex?js_string}/i")==null) {
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match(/${validator.urlRegex}/i)==null) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
public class EmailValidatorTest extends XWorkTestCase {

public void testEmailValidity() throws Exception {
assertTrue(verifyEmailValidity("[email protected]"));
assertTrue(verifyEmailValidity("[email protected]"));
assertTrue(verifyEmailValidityWithExpression("[email protected]", "\\b^[a-z]+@[a-z]+(\\.[a-z]+)*\\.com$\\b"));
assertTrue(verifyEmailValidity("[email protected]"));
Expand Down

0 comments on commit c3ec2c3

Please sign in to comment.