Unverified Commit 57b56d3a authored by NGPixel's avatar NGPixel

fix: validate svg file extension in addition to client mime type

parent e79e591f
......@@ -100,7 +100,13 @@ module.exports = class Asset extends Model {
}
// Sanitize SVG contents
if (WIKI.config.uploads.scanSVG && opts.mimetype === 'image/svg+xml') {
if (
WIKI.config.uploads.scanSVG &&
(
opts.mimetype.toLowerCase().startsWith('image/svg') ||
opts.ext.toLowerCase() === 'svg'
)
) {
const svgSanitizeJob = await WIKI.scheduler.registerJob({
name: 'sanitize-svg',
immediate: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment