sanitizing uploaded filename without using slugify, in composer, re comment in: #6011

v1.18.x
Julian Lam 7 years ago
parent 6f02974762
commit 9f670fe586

@ -57,7 +57,7 @@
"morgan": "^1.9.0",
"mousetrap": "^1.6.1",
"nconf": "^0.8.5",
"nodebb-plugin-composer-default": "6.0.1",
"nodebb-plugin-composer-default": "6.0.2",
"nodebb-plugin-dbsearch": "2.0.8",
"nodebb-plugin-emoji-extended": "1.1.1",
"nodebb-plugin-emoji-one": "1.2.1",

@ -8,20 +8,9 @@ var jimp = require('jimp');
var mkdirp = require('mkdirp');
var mime = require('mime');
var utils = require('./utils');
var file = module.exports;
file.saveFileToLocal = function (filename, folder, tempPath, callback) {
/*
* remarkable doesn't allow spaces in hyperlinks, once that's fixed, remove this.
*/
filename = filename.split('.');
filename.forEach(function (name, idx) {
filename[idx] = utils.slugify(name);
});
filename = filename.join('.');
var uploadPath = path.join(nconf.get('upload_path'), folder, filename);
winston.verbose('Saving file ' + filename + ' to : ' + uploadPath);

Loading…
Cancel
Save