From 665c23ae44118f52bfba050a399826b3a3192b77 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 28 Mar 2018 19:55:01 +0200 Subject: [PATCH] New validation rule for a new invalid date format added (Exception Parse Data #45) --- src/IMAP/Message.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/IMAP/Message.php b/src/IMAP/Message.php index 0324b84..4a48ad5 100644 --- a/src/IMAP/Message.php +++ b/src/IMAP/Message.php @@ -249,6 +249,7 @@ private function parseHeader() { * ^ Datetime ^ Problem ^ Cause ^ * | Mon, 20 Nov 2017 20:31:31 +0800 (GMT+8:00) | Double timezone specification | A Windows feature | * | | and invalid timezone (max 6 char) | | + * | 04 Jan 2018 10:12:47 UT | Missing letter "C" | Unknown * * Please report any new invalid timestamps to [#45](https://github.com/Webklex/laravel-imap/issues/45) */ @@ -261,6 +262,9 @@ private function parseHeader() { $array = array_reverse($array); $date = trim(array_pop($array)); break; + case preg_match('/([0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ UT)+$/i', $date): + $date .= 'C'; + break; } $this->date = Carbon::parse($date); }