* Mail: fix broken PDF attachments which were quoted-printable encoded

This commit is contained in:
ralf 2024-06-24 09:42:25 +02:00
parent 714e4b2169
commit 7772fd25ed

View File

@ -6259,7 +6259,7 @@ class Mail
// set binary, as it's already base64 transfer-encoded but lacks the necessary header // set binary, as it's already base64 transfer-encoded but lacks the necessary header
if (($part->getType() === 'application/pdf' || $part->getPrimaryType() === 'image') && if (($part->getType() === 'application/pdf' || $part->getPrimaryType() === 'image') &&
// hack to read protected $structure->_transfer_encoding // hack to read protected $structure->_transfer_encoding
unserialize($part->serialize())[9] !== 'base64') !in_array(unserialize($part->serialize())[9], ['base64', 'quoted-printable']))
{ {
$part->setTransferEncoding('binary', ['send' => true]); $part->setTransferEncoding('binary', ['send' => true]);
return true; return true;