Commit 32473df5 authored by anton's avatar anton
Browse files

Slugify all dirs in path of uploaded files

parent 118c0f35
Pipeline #112149 passed with stages
in 54 seconds
......@@ -161,7 +161,10 @@ class Assets extends Service {
let filename = `${slug}${extname.toLowerCase()}`
if (req.body.basePath) {
filename = path.join(req.body.basePath, filename)
const basePath = req.body.basePath.split('/')
.map(dir => ObjectUtil.slug(dir))
.join('/')
filename = path.join(basePath, filename)
}
/** Put object */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment