Skip to content
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

Empty date - "parseDateTime() expects parameter 1 to be a parsable string datetime" #318

Closed
nssnl opened this issue May 11, 2019 · 1 comment
Labels
needs investigation This will be tested / debugged or checked out.

Comments

@nssnl
Copy link

nssnl commented May 11, 2019

I found an issue with an empty date line. The e-mail has a line with "Date:", but it's empty afterwards. As a result, I'm getting the following error:

parseDateTime() expects parameter 1 to be a parsable string datetime

Tested with version 3.0.14.

By editing Mailbox.php it can be solved by adding AND !empty($head->date) to line 744.

if(isset($head->date) AND !empty($head->date)) {
	$header->date = self::parseDateTime($head->date);
} else {
	$now = new DateTime;
	$header->date = self::parseDateTime($now->format('Y-m-d H:i:s'));
}

It's an e-mail sent to my Gmail box. Happy to share the original e-mail, but other than the line "Date:" with no date, there is nothing else unusual and the above solves the issue.

@nssnl nssnl added the needs investigation This will be tested / debugged or checked out. label May 11, 2019
Sebbo94BY added a commit that referenced this issue May 12, 2019
Issue #318: Fixed issue with empty date field, when date field exists
@Sebbo94BY
Copy link
Collaborator

Thanks for reporting this issue! I've quickly fixed it and published a new release 3.0.15. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This will be tested / debugged or checked out.
Projects
None yet
Development

No branches or pull requests

2 participants