mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-22 19:26:01 +03:00
Merge pull request #76 from Xethron/date-fix
Bugfix: Set overview/header date field to null if not set
This commit is contained in:
commit
c5ce7778ec
@ -272,6 +272,9 @@ class Message
|
|||||||
// returns an array, and since we just want one message we can grab the only result
|
// returns an array, and since we just want one message we can grab the only result
|
||||||
$results = imap_fetch_overview($this->imapStream, $this->uid, FT_UID);
|
$results = imap_fetch_overview($this->imapStream, $this->uid, FT_UID);
|
||||||
$this->messageOverview = array_shift($results);
|
$this->messageOverview = array_shift($results);
|
||||||
|
if ( ! isset($this->messageOverview->date)) {
|
||||||
|
$this->messageOverview->date = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->messageOverview;
|
return $this->messageOverview;
|
||||||
@ -295,7 +298,12 @@ class Message
|
|||||||
$headerObject = imap_rfc822_parse_headers($rawHeaders);
|
$headerObject = imap_rfc822_parse_headers($rawHeaders);
|
||||||
|
|
||||||
// to keep this object as close as possible to the original header object we add the udate property
|
// to keep this object as close as possible to the original header object we add the udate property
|
||||||
|
if (isset($headerObject->date)) {
|
||||||
$headerObject->udate = strtotime($headerObject->date);
|
$headerObject->udate = strtotime($headerObject->date);
|
||||||
|
} else {
|
||||||
|
$headerObject->date = null;
|
||||||
|
$headerObject->udate = null;
|
||||||
|
}
|
||||||
|
|
||||||
$this->headers = $headerObject;
|
$this->headers = $headerObject;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user