mirror of
https://github.com/retailcrm/Fetch.git
synced 2025-02-06 02:39:21 +03:00
[fix] add subject property check
This commit is contained in:
parent
68cb173bc5
commit
1c0e393b13
@ -100,6 +100,7 @@ class Attachment
|
||||
try {
|
||||
$hObject = imap_rfc822_parse_headers($header);
|
||||
|
||||
if (property_exists($hObject, 'subject')) {
|
||||
$subject = MIME::decode($hObject->subject, Message::$charset);
|
||||
$subject = preg_replace('#\s+#', ' ', $subject);
|
||||
$subject = preg_replace('#^(.{0,50})#u', '$1', $subject);
|
||||
@ -107,6 +108,7 @@ class Attachment
|
||||
if ($subject) {
|
||||
$this->filename = $subject . '.eml';
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user