From: Ian Jackson Date: Mon, 4 May 2020 18:09:43 +0000 (+0100) Subject: TOML::Tiny::Faithful: Use ISO8601 for parsing X-Git-Tag: nailing-cargo/1.0.0~233^2~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4393e008256f66589abbc8cfe7573703d83384ae;p=nailing-cargo.git TOML::Tiny::Faithful: Use ISO8601 for parsing ISO8601 is strictly more relaxed. It preserves all the information we need. Our regexps have defended us from bad data already so relaxed is fine. --- diff --git a/lib/TOML/Tiny/Faithful.pm b/lib/TOML/Tiny/Faithful.pm index 42edf1b..e372d5d 100644 --- a/lib/TOML/Tiny/Faithful.pm +++ b/lib/TOML/Tiny/Faithful.pm @@ -1,6 +1,7 @@ package TOML::Tiny::Faithful; use parent TOML::Tiny; +use DateTime::Format::ISO8601; use DateTime::Format::RFC3339; use DateTime; @@ -13,7 +14,8 @@ our @EXPORT = qw( sub _options { inflate_datetime => sub { - DateTime::Format::RFC3339->parse_datetime(shift); + # RFC3339 bombs out if there is no timezone, so we parse with 8601 + DateTime::Format::ISO8601->parse_datetime(shift) }, inflate_integer => sub { use bignum;