Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1347

Email Validation is not reliable

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 5.1.0.5
    • Fix Version/s: None
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      The Class org.apache.tapestry5.validator.Email a regex Pattern to validate a email address. This Regex is not reliable! For instance a email address like: 1111111111111@1111111.1111111111111 OR steve.jobs@app- are become valid!
      I suggest to use the org.apache.commons.validator.EmailValidator.
      In the Class org.apache.tapestry5.validator.Email I overwrote the validate function like this and the two email addresses are no more valid!

      import org.apache.commons.validator.EmailValidator;
      ......
      public void validate(Field field, Void constraintValue, MessageFormatter formatter, String value)
      throws ValidationException

      { EmailValidator ev = EmailValidator.getInstance(); if (!ev.isValid(value)) throw new ValidationException(buildMessage(formatter, field)); }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hlship Howard Lewis Ship
                Reporter:
                marcel.huber Marcel Huber
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: