Explorar o código

php: fixes JSON encoding issue, patch from Greg Dove. Close issue #1463

Franco Ponticelli %!s(int64=12) %!d(string=hai) anos
pai
achega
778fefcafb
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      std/haxe/Json.hx

+ 3 - 1
std/haxe/Json.hx

@@ -466,8 +466,10 @@ class Json {
 			}
 		}
 		else if (untyped __call__("is_array", val)) arr = val;
-		else
+		else {
+			if (untyped __call__("is_float",val) && !__call__("is_finite",val)) val = null;
 			return val;
+		}
 		return phpMapArray(arr, convertBeforeEncode);
 	}