diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c8dfa7c82..4c5fd3abea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ - Fix whitespace handling in vCard line continuation (#9637) - Fix current script state after initial scripts creation in managesieve_kolab_master mode - 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) ## Release 1.6.9 diff --git a/program/lib/Roundcube/rcube_output.php b/program/lib/Roundcube/rcube_output.php index 4e62f8ecc8..f0bc69b569 100644 --- a/program/lib/Roundcube/rcube_output.php +++ b/program/lib/Roundcube/rcube_output.php @@ -234,16 +234,16 @@ public function download_headers($filename, $params = []) if (!empty($params['type']) && is_string($params['type']) && strlen($params['type']) < 256 && preg_match('/^[a-z0-9!#$&.+^_-]+\/[a-z0-9!#$&.+^_-]+$/i', $params['type']) ) { - $ctype = $params['type']; + $ctype = strtolower($params['type']); } // Send unsafe content as plain text if ($disposition == 'inline') { - if (preg_match('~(javascript|jscript|ecmascript|xml|html|text/)~i', $ctype)) { + if ($ctype != 'image/svg+xml' && preg_match('~(javascript|jscript|ecmascript|xml|html|text/)~', $ctype)) { $ctype = 'text/plain'; } - if (stripos($ctype, 'text') === 0) { + if (strpos($ctype, 'text') === 0) { $charset = $this->charset; if (!empty($params['type_charset']) && rcube_charset::is_valid($params['type_charset'])) { $charset = $params['type_charset'];