From 4393e008256f66589abbc8cfe7573703d83384ae Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 4 May 2020 19:09:43 +0100 Subject: [PATCH] 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. --- lib/TOML/Tiny/Faithful.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.30.2