mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Allow digits in PDF filenames (#13122)
GitOrigin-RevId: 58c93d299c3bfe79dd4c223b8b060411bad078c7
This commit is contained in:
parent
9d86affec4
commit
4670c698ee
2 changed files with 3 additions and 3 deletions
|
@ -371,7 +371,7 @@ module.exports = CompileController = {
|
|||
},
|
||||
|
||||
_getSafeProjectName(project) {
|
||||
return project.name.replace(/\P{L}/gu, '_')
|
||||
return project.name.replace(/[^\p{L}\p{Nd}]/gu, '_')
|
||||
},
|
||||
|
||||
deleteAuxFiles(req, res, next) {
|
||||
|
|
|
@ -356,7 +356,7 @@ describe('CompileController', function () {
|
|||
this.req.params = { Project_id: this.projectId }
|
||||
|
||||
this.req.query = { pdfng: true }
|
||||
this.project = { name: 'test namè;' }
|
||||
this.project = { name: 'test namè; 1' }
|
||||
this.ProjectGetter.getProject = sinon
|
||||
.stub()
|
||||
.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 () {
|
||||
this.res.setContentDisposition.should.be.calledWith('inline', {
|
||||
filename: 'test_namè_.pdf',
|
||||
filename: 'test_namè__1.pdf',
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue