fix: disallow # char in file uploads (#3770)
This commit is contained in:
parent
0788d615bc
commit
9081232e7c
@ -76,7 +76,7 @@ router.post('/u', (req, res, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sanitize filename
|
// 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
|
// Check if user can upload at path
|
||||||
const assetPath = (folderId) ? hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
|
const assetPath = (folderId) ? hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
|
||||||
|
Loading…
Reference in New Issue
Block a user