mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-22 11:16:03 +03:00
Merge pull request #7 from iyzoer/fixes-deprecations
add message property check, handling imap_fetchstructure errors
This commit is contained in:
commit
2f87688e3d
@ -249,9 +249,15 @@ class Message
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$this->subject = MIME::decode($messageOverview->subject, self::$charset);
|
if (property_exists($messageOverview, 'subject')) {
|
||||||
$this->date = strtotime($messageOverview->date);
|
$this->subject = MIME::decode($messageOverview->subject, self::$charset);
|
||||||
$this->size = $messageOverview->size;
|
}
|
||||||
|
|
||||||
|
if (property_exists($messageOverview, 'date')) {
|
||||||
|
$this->date = strtotime($messageOverview->date);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->size = $messageOverview->size;
|
||||||
|
|
||||||
foreach (self::$flagTypes as $flag)
|
foreach (self::$flagTypes as $flag)
|
||||||
$this->status[$flag] = ($messageOverview->$flag == 1);
|
$this->status[$flag] = ($messageOverview->$flag == 1);
|
||||||
@ -381,7 +387,7 @@ class Message
|
|||||||
public function getStructure($forceReload = false)
|
public function getStructure($forceReload = false)
|
||||||
{
|
{
|
||||||
if ($forceReload || !isset($this->structure)) {
|
if ($forceReload || !isset($this->structure)) {
|
||||||
$this->structure = imap_fetchstructure($this->imapStream, $this->uid, FT_UID);
|
$this->structure = @imap_fetchstructure($this->imapStream, $this->uid, FT_UID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->structure;
|
return $this->structure;
|
||||||
@ -532,6 +538,10 @@ class Message
|
|||||||
*/
|
*/
|
||||||
protected function processStructure($structure, $partIdentifier = null)
|
protected function processStructure($structure, $partIdentifier = null)
|
||||||
{
|
{
|
||||||
|
if (!$structure) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$parameters = self::getParametersFromStructure($structure);
|
$parameters = self::getParametersFromStructure($structure);
|
||||||
|
|
||||||
// quick fix for Content-Disposition extended notation
|
// quick fix for Content-Disposition extended notation
|
||||||
|
Loading…
Reference in New Issue
Block a user