Skip to content

Commit 665c23a

Browse files
committed
New validation rule for a new invalid date format added (Exception Parse Data #45)
1 parent cf37511 commit 665c23a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/IMAP/Message.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ private function parseHeader() {
249249
* ^ Datetime ^ Problem ^ Cause ^
250250
* | Mon, 20 Nov 2017 20:31:31 +0800 (GMT+8:00) | Double timezone specification | A Windows feature |
251251
* | | and invalid timezone (max 6 char) | |
252+
* | 04 Jan 2018 10:12:47 UT | Missing letter "C" | Unknown
252253
*
253254
* Please report any new invalid timestamps to [#45](https://github.com/Webklex/laravel-imap/issues/45)
254255
*/
@@ -261,6 +262,9 @@ private function parseHeader() {
261262
$array = array_reverse($array);
262263
$date = trim(array_pop($array));
263264
break;
265+
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):
266+
$date .= 'C';
267+
break;
264268
}
265269
$this->date = Carbon::parse($date);
266270
}

0 commit comments

Comments
 (0)