tracker issue : CF-3316763

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

arrayFind() returns false positives

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 08/23/2012

Components: Language

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

Problem Description:
arrayContains() is supposed to be case sensitive, but when looking-up a struct, the look-up is case insensitive

Steps to Reproduce:
<cfset arrayToSearch = [{key="value"}]>
<cfset structToFind = {key="VALUE"}>

<cfdump var="#arrayToSearch#" label="arrayToSearch">
<cfdump var="#structToFind#" label="structToFind">

Was it found: #arrayFind(arrayToSearch, structToFind)#<br />

Actual Result:
Was it found: YES

Expected Result:
Was it found: NO

Any Workarounds:
Doesn't matter: it should work properly.

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

Watson Bug ID:	3316763

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:



Similar to arrayContains, arrayFind is case sensitive for strings and not for struct objects. (Comment added from ex-user id:sagarg)
Comment by Adobe D.
18402 | September 05, 2012 12:02:36 AM GMT
Yes, I get that Sagar. The point is that something can't be kinda case sensitive sometimes, and not some other times. That's a bit amateurish. CFML is not PHP. Pls sort this (and arrayContains()) out.
Comment by External U.
18403 | October 11, 2012 10:38:03 AM GMT