Skip to content

Commit

Permalink
Fix regression causing inline SVG images to be missing in mail preview (
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Sep 29, 2024
1 parent 48679ad commit ca10951
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions program/lib/Roundcube/rcube_output.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit ca10951

Please sign in to comment.