tracker issue : CF-3632972

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

serializeJSON with +0.0 returns invalid JSON

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Matt Busche / Matt Busche (Matt Busche)

Created: 09/16/2013

Components: AJAX, Plumbing

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / CF10_Update14

Priority/Frequency: Major / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 3

Problem Description: serializing a struct with a value of +0.0 result in invalid JSON

Steps to Reproduce:
<cfscript>
stPolicy = { "prem": "+0.0" };
serializedData = serializeJSON(stPolicy);
writeDump(isJSON(serializedData));
writeDump(deserializeJSON(serializedData));
</cfscript>

Actual Result: isJSON returns no, deserializeJSON returns JSON parsing failure at character 9:'+' in {"prem":+0.0}

Expected Result: isJSON is true and it can deserialize the JSON it just created

Any Workarounds: create a separate function to replace +0 with a 0, but this is not a good workaround.

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

Watson Bug ID:	3632972

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

ColdFusion 10,0,11,285437 Windows 7 64-bit

Attachments:

  1. September 17, 2013 00:00:00: 1_test.cfm

Comments:

repro case attached
Comment by External U.
14508 | September 16, 2013 12:06:12 PM GMT
Yet another CF JSON bug. This breaks on CF9 and CF10. Needless to say, Railo and OpenBD handle this fine. The JSON handling in CF is so direly flaky I really think you need to consider binning what you've done and start again. Perhaps solicit some consultancy from the Railo guys so that it gets done properly. -- Adam
Vote by External U.
14512 | September 16, 2013 12:44:14 PM GMT
JSON is important, please fix.
Vote by External U.
14513 | September 16, 2013 12:54:23 PM GMT
I confirmed that this is also a bug in CF9. Needs to be fixed.
Vote by External U.
14514 | September 16, 2013 02:14:10 PM GMT
When will this fix be released? It was not in ColdFusion 10 Update 12. How about people still on ColdFusion 9?
Comment by External U.
14509 | November 25, 2013 03:17:35 PM GMT
The fix will be out in the next major release.
Comment by Immanuel N.
14510 | December 18, 2013 06:57:36 AM GMT
Why is this not being released for ColdFusion 10? This is pretty essential functionality and is one of only dozens of JSON issues in ColdFusion 10 (that were NOT present in ColdFusion 8)
Comment by External U.
14511 | January 08, 2014 10:06:18 PM GMT