From 46a78dd17998deeb590355ce821ec6ee9e6904a2 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 18 Jul 2023 14:21:42 -0600 Subject: [PATCH] Mail: When importing from mail, prefer attachement filename when available Fixes missing extensions in link name --- mail/inc/class.mail_integration.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mail/inc/class.mail_integration.inc.php b/mail/inc/class.mail_integration.inc.php index 449048fe72..fbc1ebb625 100644 --- a/mail/inc/class.mail_integration.inc.php +++ b/mail/inc/class.mail_integration.inc.php @@ -357,9 +357,9 @@ class mail_integration { foreach($mailcontent['attachments'] as $key => $attachment) { $data_attachments[$key] = array( - 'name' => $mailcontent['attachments'][$key]['name'], - 'type' => $mailcontent['attachments'][$key]['type'], - 'size' => $mailcontent['attachments'][$key]['size'], + 'name' => $attachment['filename'] ?? $mailcontent['attachments'][$key]['name'], + 'type' => $mailcontent['attachments'][$key]['type'], + 'size' => $mailcontent['attachments'][$key]['size'], 'tmp_name' => $mailcontent['attachments'][$key]['tmp_name'] ); if ($uid && !$mailcontent['attachments'][$key]['add_raw'])