Merge pull request #5669 from BenLubar/no-extension-upload

Fix uploads of files with no extension failing when there is no restriction on file extensions.
v1.18.x
Barış Soner Uşaklı 8 years ago committed by GitHub
commit 073460ecf3

@ -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(', ') + ']]'));
}

Loading…
Cancel
Save