From a23246ff7cd865d40e7e5d9b81b4e294f4d54a1f Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 1 Feb 2024 10:22:54 -0800 Subject: [PATCH] Work around dateTime bug in Respect/Validation 2.3 The DateTime::RFC3339 formats no longer work with valid RFC 3339 timestamps. See https://github.com/Respect/Validation/issues/1442. --- src/MinFraud/Validation/Rules/Event.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/MinFraud/Validation/Rules/Event.php b/src/MinFraud/Validation/Rules/Event.php index ea2a33c6..7f6548fe 100644 --- a/src/MinFraud/Validation/Rules/Event.php +++ b/src/MinFraud/Validation/Rules/Event.php @@ -20,7 +20,12 @@ public function __construct() 'time', v::anyOf( v::dateTime(\DateTime::RFC3339), - v::dateTime(\DateTime::RFC3339_EXTENDED) + v::dateTime(\DateTime::RFC3339_EXTENDED), + // Respect/Validation no longer correctly supports the RFC 3339 + // formats as of 2.3. See + // https://github.com/Respect/Validation/issues/1442. + v::dateTime('Y-m-d\TH:i:sp'), + v::dateTime('Y-m-d\TH:i:s.vp'), ), false ),