Status/Resolution/Reason: To Test//HaveNewInfo
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 06/18/2018
Components: Language, Functions
Versions: 2018
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2018.0.0.310409 /
Priority/Frequency: Normal / Some users will encounter
Locale/System: / Platforms All
Vote Count: 0
Note: In ColdFusion, all simple values can be treated/validated as a string. A UDF string argument accepts a date. IsValid("string", now()) returns true. Etc, etc.
Issue: ArrayFindNoCase denies some strings
Repro 1:
ArrayFindAllNoCase/ArrayContainsNoCase/ArrayDelete accept any string, including date (good)
{code:java}
<cfscript>
myArray=[]
writeOutput(arrayFind(myArray, now()))//0
writeOutput(arrayLen(arrayFindAll(myArray, now())))//0
writeOutput(arrayContains(myArray, now()))//NO
writeOutput(arrayDelete(myArray, now()))//NO
writeOutput(arrayLen(arrayFindAllNoCase(myArray, now())))//0
writeOutput(arrayContainsNoCase(myArray, now()))//NO
writeOutput(arrayDeleteNoCase(myArray, now()))//NO
</cfscript>
{code}
Actual and Expected Result: 00NONO0NONO
Repro 2:
ArrayFindNoCase denies dates (bad)
{code:java}
<cfscript>
myArray=[]
writeOutput(arrayFindNoCase(myArray, now()))//exception
</cfscript>
{code}
Actual Result: exception "Valid datatype for element to search is String."
Expected Result: 0
Basically, in the following, arrayFindNoCase() must never throw an exception when a date is passed to the myString argument and thru isValid("string", ..):
{code:java}
<cfscript>
function f(required array myArray=[], required string myString) {
if(isValid("string", myString)) {
writeOutput(arrayFindNoCase(myArray, myString))
}
}
</cfscript>
{code}
Attachments:
Comments: