tracker issue : CF-3725691

select a category, or use search below
(searches all categories and all time range)
Title:

isValid() accepts email addresses with leading / trailing whitespace.

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Ben Nadel / Ben Nadel (Ben Nadel)

Created: 03/18/2014

Components: Core Runtime

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Mac 10 All

Vote Count: 2

isValid( "email" ) will return True for email addresses that have leading and or trailing whitespace.

See: http://www.bennadel.com/blog/2593-IsValid-Accepts-Emails-With-Leading-And-Trailing-Whitespace-In-ColdFusion.htm

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3725691

External Customer Info:
External Company:  
External Customer Name: BenNadel
External Customer Email:

Attachments:

Comments:

+1 / [subscribe] -- Adam //////
Vote by External U.
13057 | March 18, 2014 07:54:15 AM GMT
Forces us to use trim before using the isValid method. Should not be necessary.
Vote by External U.
13058 | March 26, 2014 12:29:57 PM GMT
As per the RFC for email address, there should not be any space, unless escaped. So considering the RFC, this should be fixed. However, Java Mail API and cfmail automatically trims the mail address before using it and therefore any leading/trailing space would not cause any error there. There might be some code which is relying on this incorrect behavior of isValid and they would need to be changed. Do you see any concern?
Comment by Rupesh K.
13053 | November 03, 2014 12:49:18 AM GMT
No response from the code and so closing the bug. Thanks, Suchika.
Comment by Suchika S.
13054 | May 14, 2015 04:10:07 AM GMT
Who were you expecting a response from? Rupesh was pretty clear that this was a valid bug. The only question was whether or not fixing the bug would break existing applications that for some reason depended on the incorrect behavior of isValid() (which is probably unlikely). Since no one responded, the bug should be fixed rather than closed as "NotABug".
Comment by External U.
13055 | May 15, 2015 10:07:44 AM GMT
Agreed. It's a bug. Fix it. Rupesh's assertion of "However, Java Mail API and cfmail automatically trims the mail address" is specious because the function is not isValid("emailForJavaMail"), it's isValid("email"). And an email with leading and trailing space is invalid. Ergo: isValid("email") should fail it. Rupesh's second assertion that somehow a fictitious group of ppl might have specifically written code which relies on a clear bug, and that their situation should somehow trump the situations of *everyone else* using the function expecting it to work as intended stretches way beyond "specious" and into the realms of "that simply wasn't worth thinking about, much less taking the time to write down". Everyone agrees this is a bug. The rationales provided to mitigate it and be concerned about backwards compat are basically invalid. It ought to be fixed. It's pretty poor form from Adobe that the reaction to this bug wasn't simply "yeah, we'll fix it", and then just fix it.
Comment by External U.
13056 | May 16, 2015 06:52:22 AM GMT