Skip to content

Node.js based forum software built for the modern web

fix: use filename to check for svg, tempPath doesn't always have extension

Barış Soner Uşaklı5bcf078a75ee
diff --git a/src/file.js b/src/file.js
index 4c3c911950..7bfc957a94 100644
--- a/src/file.js
+++ b/src/file.js
@@ -28,7 +28,7 @@ file.saveFileToLocal = async function (filename, folder, tempPath) {
winston.verbose(`Saving file ${filename} to : ${uploadPath}`);
await mkdirp(path.dirname(uploadPath));
- if (tempPath.endsWith('.svg')) {
+ if (filename.endsWith('.svg')) {
await sanitizeSvg(tempPath);
}