From 87481b96562973d3f4684efb4e8401b3b7a663d5 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MinFraud/Validation/Rules/Event.php b/src/MinFraud/Validation/Rules/Event.php index ea2a33c6..20215b85 100644 --- a/src/MinFraud/Validation/Rules/Event.php +++ b/src/MinFraud/Validation/Rules/Event.php @@ -20,7 +20,13 @@ 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 ),