Skip to content

Commit

Permalink
fix(profile): svg images
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed May 14, 2022
1 parent bbbb992 commit 4575ed7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/controllers/accounts.js
Expand Up @@ -473,7 +473,8 @@ accountsController.uploadImage = function (req, res) {
busboy.on('file', function (name, file, info) {
const filename = info.filename
const mimetype = info.mimeType
if (mimetype.indexOf('image/') === -1) {
const ext = path.extname(filename)
if (mimetype.indexOf('image/') === -1 || ext === '.svg') {
error = {
status: 400,
message: 'Invalid File Type'
Expand Down
2 changes: 1 addition & 1 deletion src/public/js/modules/ajaximgupload.js
Expand Up @@ -39,7 +39,7 @@ define('modules/ajaximgupload', ['jquery', 'underscore', 'modules/helpers'], fun
error: function (err) {
console.log('[trudesk:ajaximgupload:onChange] Error - ', err)
helpers.UI.showSnackbar({
text: 'An error occurred. Please check console. 2',
text: 'An error occurred. Please check console. (' + err.responseText + ')',
actionTextColor: '#B92929'
})
}
Expand Down

0 comments on commit 4575ed7

Please sign in to comment.