v1.18.x
Barış Soner Uşaklı 8 years ago
parent 7a1a030865
commit 13a04123e0

@ -209,7 +209,8 @@ uploadsController.uploadFile = function (uid, uploadedFile, callback) {
}
var allowed = file.allowedExtensions();
var extension = path.extname(uploadedFile.name);
var extension = path.extname(uploadedFile.name).toLowerCase();
if (!extension || extension === '.' || (allowed.length > 0 && allowed.indexOf(extension) === -1)) {
return callback(new Error('[[error:invalid-file-type, ' + allowed.join(', ') + ']]'));
}

@ -81,7 +81,7 @@ file.allowedExtensions = function () {
if (!extension.startsWith('.')) {
extension = '.' + extension;
}
return extension;
return extension.toLowerCase();
});
if (allowedExtensions.indexOf('.jpg') !== -1 && allowedExtensions.indexOf('.jpeg') === -1) {

Loading…
Cancel
Save