fixes #3863 :trollface:

v1.18.x
Julian Lam 10 years ago
parent 872e00849a
commit dbe5b963bd

@ -46,17 +46,17 @@ uploadsController.upload = function(req, res, filesIterator, next) {
uploadsController.uploadPost = function(req, res, next) { uploadsController.uploadPost = function(req, res, next) {
uploadsController.upload(req, res, function(uploadedFile, next) { uploadsController.upload(req, res, function(uploadedFile, next) {
if (uploadedFile.type.match(/image./)) {
file.isFileTypeAllowed(uploadedFile.path, function(err) { file.isFileTypeAllowed(uploadedFile.path, function(err) {
if (err) { if (err) {
return next(err); return next(err);
} }
if (uploadedFile.type.match(/image./)) {
uploadImage(req.user.uid, uploadedFile, next); uploadImage(req.user.uid, uploadedFile, next);
});
} else { } else {
uploadFile(req.user.uid, uploadedFile, next); uploadFile(req.user.uid, uploadedFile, next);
} }
});
}, next); }, next);
}; };

Loading…
Cancel
Save