From 256f8112178fea29e31652a127917e9933535a74 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 22 Oct 2013 21:07:09 +0200 Subject: Update CSP header; change order to fix svg display in firefox Apparently firefox doesn't like "style-src * 'unsafe-inline'", but wants "style-src 'unsafe-inline' *" otherwise it doesn't honor 'unsafe-inline'. In chromium both behave the same. Signed-off-by: Florian Pritz --- application/controllers/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/file.php b/application/controllers/file.php index 4d88ed465..8e2f35430 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -121,7 +121,7 @@ class File extends MY_Controller { // prevent javascript from being executed and forbid frames // this should allow us to serve user submitted HTML content without huge security risks foreach (array("X-WebKit-CSP", "X-Content-Security-Policy", "Content-Security-Policy") as $header_name) { - header("$header_name: allow 'none'; img-src *; media-src *; font-src *; style-src * 'unsafe-inline'; script-src 'none'; object-src *; frame-src 'none'; "); + header("$header_name: default-src 'none'; img-src *; media-src *; font-src *; style-src 'unsafe-inline' *; script-src 'none'; object-src *; frame-src 'none'; "); } handle_etag($etag); $this->ddownload->serveFile($file, $filedata["filename"], $filedata["mimetype"]); -- cgit v1.2.3-24-g4f1b