diff --git a/src/controllers/uploads.js b/src/controllers/uploads.js index 3ef09c89cc..39db4bc00b 100644 --- a/src/controllers/uploads.js +++ b/src/controllers/uploads.js @@ -211,7 +211,7 @@ uploadsController.uploadFile = function (uid, uploadedFile, callback) { var allowed = file.allowedExtensions(); var extension = path.extname(uploadedFile.name).toLowerCase(); - if (!extension || extension === '.' || (allowed.length > 0 && allowed.indexOf(extension) === -1)) { + if (allowed.length > 0 && (!extension || extension === '.' || allowed.indexOf(extension) === -1)) { return callback(new Error('[[error:invalid-file-type, ' + allowed.join(', ') + ']]')); }