Skip to content

Commit

Permalink
New validation rule for a new invalid date format added (Exception Pa…
Browse files Browse the repository at this point in the history
…rse Data #45)
  • Loading branch information
Webklex committed Mar 28, 2018
1 parent cf37511 commit 665c23a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/IMAP/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand All @@ -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);
}
Expand Down

0 comments on commit 665c23a

Please sign in to comment.