diff options
author | Aleksander Machniak <alec@alec.pl> | 2022-01-22 11:43:01 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2022-01-22 11:43:01 +0300 |
commit | ca5ba9550f31394372531e6ac6c5c61c8f6c6399 (patch) | |
tree | 2028b61af481b503c45ee8b914f7ce8f4e89175e | |
parent | e1a900496659d9c2014f01ac2d24248a5607288e (diff) |
Fix bug where small message/rfc822 parts could not be decoded (#8408)
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | program/lib/Roundcube/rcube_message.php | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9481e3f02..80af735e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ - Fix so PHP warnings are ignored when resizing a malformed image attachment (#8387) - Fix various PHP8 warnings (#8392) - Fix mail headers injection via the subject field on mail compose (#8404) +- Fix bug where small message/rfc822 parts could not be decoded (#8408) ## Release 1.5.2 diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php index 206ae807d..8bd20be10 100644 --- a/program/lib/Roundcube/rcube_message.php +++ b/program/lib/Roundcube/rcube_message.php @@ -615,7 +615,8 @@ class rcube_message // For small text messages we can optimize, so an additional FETCH is not needed if ($structure->size < 32768 && count($structure->parts) == 1 && $structure->parts[0]->ctype_primary == 'text') { - $structure->parts[0]->body = $body; + $encoding = $structure->headers['content-transfer-encoding'] ?? '7bit'; + $structure->parts[0]->body = rcube_mime::decode($body, $encoding); } } } |