mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Allow all Unicode "letter" characters in PDF filename (#13071)
GitOrigin-RevId: 030d7326b33525a34bccff26e12103e9a8e1a3f3
This commit is contained in:
parent
7f795e4c8b
commit
c8c17bca38
2 changed files with 3 additions and 5 deletions
|
@ -371,9 +371,7 @@ module.exports = CompileController = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_getSafeProjectName(project) {
|
_getSafeProjectName(project) {
|
||||||
const wordRegExp = /\W/g
|
return project.name.replace(/\P{L}/gu, '_')
|
||||||
const safeProjectName = project.name.replace(wordRegExp, '_')
|
|
||||||
return safeProjectName
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteAuxFiles(req, res, next) {
|
deleteAuxFiles(req, res, next) {
|
||||||
|
|
|
@ -356,7 +356,7 @@ describe('CompileController', function () {
|
||||||
this.req.params = { Project_id: this.projectId }
|
this.req.params = { Project_id: this.projectId }
|
||||||
|
|
||||||
this.req.query = { pdfng: true }
|
this.req.query = { pdfng: true }
|
||||||
this.project = { name: 'test namè' }
|
this.project = { name: 'test namè;' }
|
||||||
this.ProjectGetter.getProject = sinon
|
this.ProjectGetter.getProject = sinon
|
||||||
.stub()
|
.stub()
|
||||||
.callsArgWith(2, null, this.project)
|
.callsArgWith(2, null, this.project)
|
||||||
|
@ -380,7 +380,7 @@ describe('CompileController', function () {
|
||||||
|
|
||||||
it('should set the content-disposition header with a safe version of the project name', function () {
|
it('should set the content-disposition header with a safe version of the project name', function () {
|
||||||
this.res.setContentDisposition.should.be.calledWith('inline', {
|
this.res.setContentDisposition.should.be.calledWith('inline', {
|
||||||
filename: 'test_nam_.pdf',
|
filename: 'test_namè_.pdf',
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue