tracker issue : CF-3834534

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

Argument validation broken, at least with ReplaceList

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): Tim Parker / Tim Parker (Tim Parker)

Created: 10/01/2014

Components: Language

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Platforms All

Vote Count: 0

Problem Description: Calling ReplaceList() with extra arguments results in no reported errors and unexpected results - same code run on CF9 throws expected runtime exception

Steps to Reproduce: run the following code:
<cfscript>
	fubar = '<a href="fubar">link to fubar</a>';
	WriteOutput(ReplaceList("(bad args to ReplaceList) #fubar#","<,>", "&lt;,&gt;","all")); // runtime error expected here due to extra 'all' argument
	WriteOutput("<hr />");
	WriteOutput(ReplaceList("(correct args to ReplaceList) #fubar#","<,>", "&lt;,&gt;"));
	WriteOutput("<hr />something else");
	baz = "<br />something else again";
	WriteOutput(baz);
</cfscript>


Actual Result: code runs without error, first replaceList is a no-op, second (correctly called) replaceList behaves as documented

Expected Result: runtime error on first ReplaceList due to extra argument

Any Workarounds:

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

Watson Bug ID:	3834534

External Customer Info:
External Company:  
External Customer Name: TParker
External Customer Email:  
External Test Config: My Hardware and Environment details:

Windows 7 Ultimate, JDK 1.7.67 (64 bit)// 

-and-

CentOS 6.5, JDK 1.7.60 (64 bit)

Attachments:

Comments:

problem observed with CF10 (updater 13) and CF11 (updater 1). CF9 produces expected results (runtime error due to bad argument list)
Comment by External U.
10803 | October 01, 2014 04:14:50 PM GMT
ok... my bad... was using old doc... extra parameter interpreted as delimiter - easy mistake to make
Comment by External U.
10804 | October 01, 2014 04:41:03 PM GMT
Adobe, This is currently marked "ToFix". However, since ReplaceList() allows 4 parameters, no error should be thrown. So the current behavior is correct. There is no bug - as agreed by TParker. This ticket should be closed. Thanks!, -Aaron
Comment by External U.
10805 | November 24, 2014 05:12:48 AM GMT