Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metaschema DateWithTimezoneDatatype definition allows invalid timezone values #400

Closed
RS-Credentive opened this issue Jul 21, 2023 · 0 comments · Fixed by #401
Closed

Metaschema DateWithTimezoneDatatype definition allows invalid timezone values #400

RS-Credentive opened this issue Jul 21, 2023 · 0 comments · Fixed by #401

Comments

@RS-Credentive
Copy link
Contributor

<xs:pattern value="(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))(Z|[+-][0-9]{2}:[0-9]{2})"/>

The timezone portion of the regex is (Z|[+-][0-9]{2}:[0-9]{2})

According to RFC 3339, the proper format is:

   time-hour       = 2DIGIT  ; 00-23
   time-minute     = 2DIGIT  ; 00-59
  <...>
   time-numoffset  = ("+" / "-") time-hour ":" time-minute
   time-offset     = "Z" / time-numoffset

The timezone regex should be (Z|([+|-])([0-1][0-9]|2[0-3]):([0-5][0-9]))

There is a similar error here:

<xs:pattern value="(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|\+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))"/>

RS-Credentive added a commit to Credentive-Sec/metaschema that referenced this issue Jul 21, 2023
@RS-Credentive RS-Credentive mentioned this issue Jul 21, 2023
8 tasks
@david-waltermire david-waltermire added this to the Metaschema 0.10.0 milestone Jul 26, 2023
@david-waltermire david-waltermire linked a pull request Jul 29, 2023 that will close this issue
8 tasks
david-waltermire added a commit that referenced this issue Jul 29, 2023
* Corrected TZ pattern in XML and JSON date data types. Resolves #400

Co-authored-by: David Waltermire <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants