From 30761e6d1f8039e0674ee0de608977d1d83a649c Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Mon, 24 Feb 2020 14:29:27 +0000 Subject: [PATCH] Added mime check to svg check so that it doesn't try to load every upload into memory --- ext/handle_svg/main.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/handle_svg/main.php b/ext/handle_svg/main.php index f8c8bef2..84eb19a6 100644 --- a/ext/handle_svg/main.php +++ b/ext/handle_svg/main.php @@ -67,6 +67,10 @@ class SVGFileHandler extends DataHandlerExtension protected function check_contents(string $file): bool { + if (getMimeType($file)!="image/svg+xml") { + return false; + } + $msp = new MiniSVGParser($file); return bool_escape($msp->valid); }