mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-22 03:06:02 +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,8 +249,14 @@ class Message
|
||||
|
||||
return false;
|
||||
|
||||
if (property_exists($messageOverview, 'subject')) {
|
||||
$this->subject = MIME::decode($messageOverview->subject, self::$charset);
|
||||
}
|
||||
|
||||
if (property_exists($messageOverview, 'date')) {
|
||||
$this->date = strtotime($messageOverview->date);
|
||||
}
|
||||
|
||||
$this->size = $messageOverview->size;
|
||||
|
||||
foreach (self::$flagTypes as $flag)
|
||||
@ -381,7 +387,7 @@ class Message
|
||||
public function getStructure($forceReload = false)
|
||||
{
|
||||
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;
|
||||
@ -532,6 +538,10 @@ class Message
|
||||
*/
|
||||
protected function processStructure($structure, $partIdentifier = null)
|
||||
{
|
||||
if (!$structure) {
|
||||
return;
|
||||
}
|
||||
|
||||
$parameters = self::getParametersFromStructure($structure);
|
||||
|
||||
// quick fix for Content-Disposition extended notation
|
||||
|
Loading…
Reference in New Issue
Block a user