Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-395

Email address with leading/trailing space(s) are considered valid.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.1
    • Component/s: Routines
    • Labels:
      None

      Description

      I recently replaced our custom email regex we were using in our project with org.apache.commons.validator.routines.EmailValidator, but it broke 2 of my cases in the unit tests I had written for it:

      -" leading@space.com" expected to be invalid
      -"trailing@space.com " expected to be invalid

      Are those considered valid in RFC1034/RFC1123? If not, a simple fix would be to check for leading/trailing spaces at the same location were you check that the email doesn't end with a period, at line 162 or EmailValidator.java, since it's cheap as well.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mathieu.neron.ing@gmail.com Mathieu Neron
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified