mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
path join on user routers
This commit is contained in:
@@ -113,8 +113,7 @@ var user = require('./../user.js'),
|
||||
return;
|
||||
}
|
||||
|
||||
var filename = path.basename(oldpicture);
|
||||
var absolutePath = global.configuration['ROOT_DIRECTORY'] + config.upload_path + filename;
|
||||
var absolutePath = path.join(global.configuration['ROOT_DIRECTORY'], config.upload_path, path.basename(oldpicture));
|
||||
|
||||
fs.unlink(absolutePath, function(err) {
|
||||
if(err) {
|
||||
@@ -124,9 +123,7 @@ var user = require('./../user.js'),
|
||||
uploadUserPicture(req.user.uid, req.files.userPhoto.name, req.files.userPhoto.path, res);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function uploadUserPicture(uid, filename, tempPath, res) {
|
||||
@@ -165,8 +162,10 @@ var user = require('./../user.js'),
|
||||
dstPath: global.configuration['ROOT_DIRECTORY'] + uploadPath,
|
||||
width: 128
|
||||
}, function(err, stdout, stderr){
|
||||
if (err)
|
||||
if (err) {
|
||||
console.log(err);
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user