Skip to content

Commit

Permalink
[Email] Email log: do not allow script/iframe execution in preview wi…
Browse files Browse the repository at this point in the history
…ndow
  • Loading branch information
brusch committed Oct 30, 2019
1 parent 30a9111 commit e0b48fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bundles/AdminBundle/Controller/Admin/EmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public function showEmailLogAction(Request $request, ?Profiler $profiler)

return new Response('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style>body{background-color:#fff;}</style></head><body><pre>' . $templatingEnginePhp->escape($emailLog->getTextLog()) . '</pre></body></html>');
} elseif ($request->get('type') == 'html') {
return new Response($emailLog->getHtmlLog());
return new Response($emailLog->getHtmlLog(), 200, [
'Content-Security-Policy' => "default-src 'self'; style-src 'self' 'unsafe-inline'"
]);
} elseif ($request->get('type') == 'params') {
try {
$params = $this->decodeJson($emailLog->getParams());
Expand Down

0 comments on commit e0b48fa

Please sign in to comment.