Skip to content

Commit

Permalink
fix: disallow # char in file uploads (#3770)
Browse files Browse the repository at this point in the history
  • Loading branch information
opalmay authored May 20, 2021
1 parent 0788d61 commit 9081232
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/controllers/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ router.post('/u', (req, res, next) => {
}

// Sanitize filename
fileMeta.originalname = sanitize(fileMeta.originalname.toLowerCase().replace(/[\s,;]+/g, '_'))
fileMeta.originalname = sanitize(fileMeta.originalname.toLowerCase().replace(/[\s,;#]+/g, '_'))

// Check if user can upload at path
const assetPath = (folderId) ? hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
Expand Down

0 comments on commit 9081232

Please sign in to comment.