diff --git a/src/main/java/org/json/JSONArray.java b/src/main/java/org/json/JSONArray.java index c2e5c9a..7d12f98 100644 --- a/src/main/java/org/json/JSONArray.java +++ b/src/main/java/org/json/JSONArray.java @@ -105,6 +105,8 @@ public class JSONArray implements Iterable { if (nextChar == 0) { // array is unclosed. No ']' found, instead EOF throw x.syntaxError("Expected a ',' or ']'"); + } else if (nextChar==',' && jsonParserConfiguration.isStrictMode()) { + throw x.syntaxError("Array content starts with a ','"); } if (nextChar != ']') { x.back();