From 60d93bd3f3bbbcfa8e1db6f3147468b8cf86ff55 Mon Sep 17 00:00:00 2001 From: Sebastian Gierlinger Date: Tue, 17 Sep 2013 22:11:22 +0200 Subject: [PATCH] Fix for images with special chars closes #780 - added replacing of special chars with '_' --- core/server/controllers/admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/controllers/admin.js b/core/server/controllers/admin.js index 93a7cfc617..de38ded460 100644 --- a/core/server/controllers/admin.js +++ b/core/server/controllers/admin.js @@ -78,7 +78,7 @@ adminControllers = { tmp_path = req.files.uploadimage.path, dir = path.join('content/images', year, month), ext = path.extname(req.files.uploadimage.name).toLowerCase(), - basename = path.basename(req.files.uploadimage.name, ext); + basename = path.basename(req.files.uploadimage.name, ext).replace(/[\W]/gi, '_'); function renameFile(target_path) { // adds directories recursively