fix bug allowing invalid characters in pdf name
This commit is contained in:
parent
572be373e5
commit
ad00695d4e
|
@ -2142,7 +2142,7 @@ public class DataManagementPlanManager {
|
||||||
throw new Exception("DMP already has a DOI");*/
|
throw new Exception("DMP already has a DOI");*/
|
||||||
|
|
||||||
FileEnvelope file = getWordDocument(depositRequest.getDmpId(), principal, configLoader);
|
FileEnvelope file = getWordDocument(depositRequest.getDmpId(), principal, configLoader);
|
||||||
String name = file.getFilename().substring(0, file.getFilename().length() - 5).replace(" ", "_").replace(",", "_");
|
String name = file.getFilename().substring(0, file.getFilename().length() - 5).replaceAll("[^a-zA-Z0-9_+ ]", "").replace(" ", "_").replace(",", "_");
|
||||||
File pdfFile = PDFUtils.convertToPDF(file, environment);
|
File pdfFile = PDFUtils.convertToPDF(file, environment);
|
||||||
String fileName = name + ".pdf";
|
String fileName = name + ".pdf";
|
||||||
ResponseEntity<byte[]> jsonFile;
|
ResponseEntity<byte[]> jsonFile;
|
||||||
|
|
Loading…
Reference in New Issue