Skip to content

Commit

Permalink
Improve html message rendering
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny committed Nov 5, 2020
1 parent b7de0e3 commit 175240a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Controller/ProxyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ public function proxy(string $src): ProxyDownloadResponse {
$client = $this->clientService->newClient();
$response = $client->get($src);
$content = $response->getBody();
return new ProxyDownloadResponse($content, $src, 'application/octet-stream');

// Only proxy content type of svgs (fix display in chromium based browsers)
$contentType = $response->getHeader('Content-Type');
if ($contentType !== 'image/svg+xml') {
$contentType = 'application/octet-stream';
}

return new ProxyDownloadResponse($content, $src, $contentType);
}
}
2 changes: 2 additions & 0 deletions lib/Service/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public function sanitizeHtmlMailBody(string $mailBody, array $messageParameters,
$config->set('URI.Host', Util::getServerHostName());

$config->set('Filter.ExtractStyleBlocks', true);
$config->set('CSS.AllowTricky', true);
$config->set('CSS.Proprietary', true);

// Disable the cache since ownCloud has no really appcache
// TODO: Fix this - requires https://github.com/owncloud/core/issues/10767 to be fixed
Expand Down

0 comments on commit 175240a

Please sign in to comment.