Skip to content

Commit

Permalink
feat(stleary#871-strictMode): improved validation, strict mode for qu…
Browse files Browse the repository at this point in the history
…otes implementation
  • Loading branch information
rikkarth committed Mar 15, 2024
1 parent c140e91 commit e67abb3
Show file tree
Hide file tree
Showing 4 changed files with 953 additions and 1,084 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/json/JSONArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ public JSONArray(JSONTokener x, JSONParserConfiguration jsonParserConfiguration)
this.myArrayList.add(JSONObject.NULL);
} else {
x.back();
this.myArrayList.add(x.nextValue());
if (jsonParserConfiguration.isStrictMode()) {
this.myArrayList.add(x.nextValue(true));
} else {
this.myArrayList.add(x.nextValue());
}
}
switch (x.nextClean()) {
case 0:
Expand Down Expand Up @@ -1693,7 +1697,8 @@ private void addAll(Object array, boolean wrap, int recursionDepth) {
* @throws JSONException If not an array or if an array value is non-finite number.
* @throws NullPointerException Thrown if the array parameter is null.
*/
private void addAll(Object array, boolean wrap, int recursionDepth, JSONParserConfiguration jsonParserConfiguration)
private void addAll(Object array, boolean wrap, int recursionDepth, JSONParserConfiguration
jsonParserConfiguration)
throws JSONException {
if (array.getClass().isArray()) {
int length = Array.getLength(array);
Expand Down
Loading

0 comments on commit e67abb3

Please sign in to comment.