-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception Parse Data #45
Comments
Hi @GuiAndra , Please give me a few days or perhaps the upcomming weekend to come up with a fix :) Best regards |
Sure @Webklex, i'm waiting for the fix. thanks :) |
Thaanks @Webklex :) |
04 Jan 2018 10:12:47 UT is a timestamp I have in one of the emails I'm trying to read. This caused a crash because of Carbon::parse. Edit: My dirty fix was to replace
with
in https://github.com/Webklex/laravel-imap/blob/master/src/IMAP/Message.php but as I said, quick and dirty. |
@RpCoding thanks for your report :) I just released a new version containing the new validation rule. Ref.: v. 1.0.5.5 |
Hello, please help me, How can i reply to message from laravel application |
Got a new invalid timestamp. :) |
I got a new error into datetime: Sugestion switch (true) {
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:
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:
case preg_match('/([0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{2,4}\ [0-9]{2}\:[0-9]{2}\:[0-9]{2}\ [A-Z]{2}\ \-[0-9]{2}\:[0-9]{2}\ \([A-Z]{2,3}\ \-[0-9]{2}:[0-9]{2}\))+$/i', $date) > 0:
$date = str_replace(' ', ' ', $date);
$array = explode('(', $date);
$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) > 0:
$date .= 'C';
break;
} |
@tortato wow you've found a new way to write a date^^ Thanks for the report and a solution. This will be part of the next release :) Best regards |
@Webklex |
@Webklex |
'DateTime::__construct(): Failed to parse time string (Mon, 4 Feb 2019 04:03:49 -0300 (-03)) at position 32 ((): Unexpected character Note: there are 2 spaces between "Mon," and "4" |
Hi @tortato @VijayTahkur @archond @anibalealvarezs , |
Hi @Webklex v 1.4.1 |
@Webklex v.1.4.2 |
@Webklex
|
Getting the following error: We are on version 1.6.2. Is this particular date error handled in later versions? |
For anyone that comes across this in the future, you can switch over to php-imap with very minor changes to your code and you can pass in a fallback_date to deal with errors related to parsing time strings. https://github.com/Webklex/php-imap/blob/master/src/Header.php#L736
|
Hello, I'm getting this exception
I added a try in the parse header function in the message class to pass the error.
private function parseHeader() {
$header = imap_fetchheader($this->client->connection, $this->uid, $this->fetch_options);
if ($header) {
$header = imap_rfc822_parse_headers($header);
}
}
The text was updated successfully, but these errors were encountered: