From 079c0b75eeceebe885447566202d5bba18cd4021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Mon, 2 Aug 2021 14:43:21 +0200 Subject: [PATCH] MDL-72242 files: Do not force text filtering of SVG files It was a mistake to force filtering of SVG files in MDL-55243. It can easily lead to corrupted SVG files. The patch removes that forced filtering and clarifies the inline comment of what and why we need to do. --- lib/filelib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/filelib.php b/lib/filelib.php index cd050b1cd12..94511d5f3bf 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -2529,10 +2529,9 @@ function send_file($path, $filename, $lifetime = null , $filter=0, $pathisstring $filename = rawurlencode($filename); } - // We need to force download and force filter the file content for the SVG file. + // Make sure we force download of SVG files for security reasons (https://digi.ninja/blog/svg_xss.php). if (file_is_svg_image_from_mimetype($mimetype)) { $forcedownload = true; - $filter = 1; } if ($forcedownload) {