Skip to content

Commit

Permalink
restrict attribute & custom field datetime deserialization to have va…
Browse files Browse the repository at this point in the history
…lid offset information
  • Loading branch information
jenschude committed Aug 11, 2023
1 parent 47bc228 commit 7f1a164
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class AtrributeDeserializer extends JsonDeserializer<AttributeImpl> {

private static Pattern p = Pattern.compile("^[0-9]");
private static Pattern dateTime = Pattern
.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,6})?");
.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,6})?(Z|[+-][0-9]{2}:[0-9]{2})");
private static Pattern date = Pattern.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}");
private static Pattern time = Pattern.compile("^[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,6})?");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CustomFieldDeserializer extends JsonDeserializer<FieldContainerImpl

private static Pattern p = Pattern.compile("^[0-9]");
private static Pattern dateTime = Pattern
.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,6})?");
.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,6})?(Z|[+-][0-9]{2}:[0-9]{2})");
private static Pattern date = Pattern.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}");
private static Pattern time = Pattern.compile("^[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,6})?");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@
"name": "datetime-simple",
"value": "2020-01-01T13:15:00Z"
},
{
"name": "datetime-text",
"value": "2018-09-24T00:00:00-0400"
},
{
"name": "datetime-offset",
"value": "2018-09-24T00:00:00-04:00"
},
{
"name": "boolean",
"value": true
Expand Down

0 comments on commit 7f1a164

Please sign in to comment.