From 572d7a1e8cb711a5e9684347d8fe17b75de3ef02 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Thu, 11 May 2017 11:25:13 -0500 Subject: [PATCH] Fix uploads of files with no extension failing when there is no restriction on file extensions. --- src/controllers/uploads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(', ') + ']]')); }