diff options
author | Mandragorat Wandystanu <wktir@wandystan.eu> | 2023-02-25 21:27:50 +0100 |
---|---|---|
committer | Mandragorat Wandystanu <wktir@wandystan.eu> | 2023-02-25 21:27:50 +0100 |
commit | d5030ce96cb6038a3dc16a79d3bdb7060e45efff (patch) | |
tree | 6d44913c2f2ac673221b29d6b7f3edb51c6b98e2 | |
parent | 18d03eb1254029267c6cde16f755cdcf34ed4344 (diff) |
Fix SVG uploads
-rw-r--r-- | static/php/upload.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/static/php/upload.php b/static/php/upload.php index 39a13d9..dc1ba81 100644 --- a/static/php/upload.php +++ b/static/php/upload.php @@ -88,6 +88,10 @@ function uploadFile($file) $finfo = new finfo(FILEINFO_MIME_TYPE); $file->mime = $finfo->file($file->tempfile); + // Fix mime type if it is returned wrong + if ($file->mime == 'image/svg') + $file->mime .= '+xml'; + // Check if mime type is blocked if (!empty($FILTER_MIME)) { if ($FILTER_MODE == true) { //whitelist mode |