Skip to content

Commit 5748cf1

Browse files
- Fixed an issue with dates. (#345)
- I was receiving the following exception with dates: - EXCEPTION: Invalid message date. ID:VI1PR07MB4766210AE35AE91886D2D766E61F9@VI1PR07MB4766.eurprd07.prod.outlook.com Date:Sat, 10, Dec 2022 09:35:19 +0100/Sat, 10, Dec 2022 09:35:19 +0100 - I added a fix for those date to be parsed correctly. Now it works fine.
1 parent 8e95709 commit 5748cf1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/Header.php

+2
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ private function parseDate($header) {
728728
case preg_match('/([A-Z]{2,3}\,\ [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) > 0:
729729
$date .= 'C';
730730
break;
731+
case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}[\,]\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4})+$/i', $date) > 0:
732+
$date = str_replace(',', '', $date);
731733
case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ \+[0-9]{2,4}\ \(\+[0-9]{1,2}\))+$/i', $date) > 0:
732734
case preg_match('/([A-Z]{2,3}[\,|\ \,]\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}.*)+$/i', $date) > 0:
733735
case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4}\ \(.*)\)+$/i', $date) > 0:

0 commit comments

Comments
 (0)