Skip to content

Commit e67abb3

Browse files
author
rikkarth
committed
feat(stleary#871-strictMode): improved validation, strict mode for quotes implementation
1 parent c140e91 commit e67abb3

4 files changed

Lines changed: 953 additions & 1084 deletions

File tree

‎src/main/java/org/json/JSONArray.java‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ public JSONArray(JSONTokener x, JSONParserConfiguration jsonParserConfiguration)
109109
this.myArrayList.add(JSONObject.NULL);
110110
} else {
111111
x.back();
112-
this.myArrayList.add(x.nextValue());
112+
if (jsonParserConfiguration.isStrictMode()) {
113+
this.myArrayList.add(x.nextValue(true));
114+
} else {
115+
this.myArrayList.add(x.nextValue());
116+
}
113117
}
114118
switch (x.nextClean()) {
115119
case 0:
@@ -1693,7 +1697,8 @@ private void addAll(Object array, boolean wrap, int recursionDepth) {
16931697
* @throws JSONException If not an array or if an array value is non-finite number.
16941698
* @throws NullPointerException Thrown if the array parameter is null.
16951699
*/
1696-
private void addAll(Object array, boolean wrap, int recursionDepth, JSONParserConfiguration jsonParserConfiguration)
1700+
private void addAll(Object array, boolean wrap, int recursionDepth, JSONParserConfiguration
1701+
jsonParserConfiguration)
16971702
throws JSONException {
16981703
if (array.getClass().isArray()) {
16991704
int length = Array.getLength(array);

0 commit comments

Comments
 (0)