fix: escape quotes in page file names

This commit seeks to fix a possible security issue described in #2991.
This commit is contained in:
David 2018-03-11 08:38:50 +07:00 committed by GitHub
parent 6b3f7ffc43
commit ce9bb082aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,7 +314,7 @@ module.exports = class Builder {
})).forEach(f => {
const key = f.replace(/\.(js|vue)$/, '')
if (/\.vue$/.test(f) || !files[key]) {
files[key] = f
files[key] = f.replace(/(['|"])/g, '\\$1')
}
})
templateVars.router.routes = createRoutes(