Browse Source

Fix PHP fatal error when parsing some malformed BODYSTRUCTURE responses (#9689)

validate-url-parameter-for-upload-v1.6
Aleksander Machniak 8 months ago
parent
commit
5c38c67287
  1. 1
      CHANGELOG.md
  2. 6
      program/lib/Roundcube/rcube_imap.php

1
CHANGELOG.md

@ -9,6 +9,7 @@
- Fix rcube_imap::get_vendor() result (and PHP warning) on Zimbra server (#9650)
- Fix regression causing inline SVG images to be missing in mail preview (#9644)
- Fix plugin "virtuser_file" to handle backward slashes in username (#9668)
- Fix PHP fatal error when parsing some malformed BODYSTRUCTURE responses (#9689)
## Release 1.6.9

6
program/lib/Roundcube/rcube_imap.php

@ -2298,8 +2298,8 @@ class rcube_imap extends rcube_storage
protected function is_attachment_part($part)
{
if (!empty($part[2]) && is_array($part[2]) && empty($part[3])) {
$params = array_map('strtolower', (array) $part[2]);
$find = ['name', 'filename', 'name*', 'filename*', 'name*0', 'filename*0', 'name*0*', 'filename*0*'];
$params = array_map('strtolower', array_filter($part[2], 'is_string'));
$find = ['name', 'filename', 'name*', 'filename*', 'name*0', 'filename*0', 'name*0*', 'filename*0*'];
// In case of malformed header check disposition. E.g. some servers for
// "Content-Type: PDF; name=test.pdf" may return text/plain and ignore name argument
@ -2419,7 +2419,7 @@ class rcube_imap extends rcube_storage
protected function structure_charset($structure)
{
while (is_array($structure)) {
if (is_array($structure[2]) && $structure[2][0] == 'charset') {
if (isset($structure[2]) && is_array($structure[2]) && $structure[2][0] == 'charset') {
return $structure[2][1];
}
$structure = $structure[0];

Loading…
Cancel
Save