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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 1.5.1
    • 1.5.1
    • Routines
    • 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

            Unassigned Unassigned
            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