From 825bb1c283aa7249277120f378794959c416d4c5 Mon Sep 17 00:00:00 2001 From: Ivan Quintero Date: Tue, 27 Oct 2015 00:53:07 -0500 Subject: [PATCH] fix leading zeroes json bug On some browser number with leading zeroes are considered strings. When receiving json number values with leading zeroes, instead of a string, an error occurs. This change checks that the number does not contain leading zeroes. --- CacheJSON.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CacheJSON.cls b/CacheJSON.cls index f10b96f..8058401 100644 --- a/CacheJSON.cls +++ b/CacheJSON.cls @@ -241,7 +241,7 @@ ClassMethod Encode(data As %DataType) As %String q:data="" "null" q """"_..Escape(data)_"""" } - elseif $ISVALIDNUM(data) { + elseif $ISVALIDNUM(data) && ($l(data) = $l($number(data))) { // type number q data