mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Escape special chars in filename which includes user input
This commit is contained in:
@@ -245,6 +245,8 @@ public class DepositManager {
|
||||
|
||||
String filenameBase =
|
||||
"sword-" + deposit.getUsername() + "-" + (new Date()).getTime();
|
||||
// No dots or slashes allowed in filename
|
||||
filenameBase = filenameBase.replaceAll("\\.", "").replaceAll("/", ""). replaceAll("\\\\", "");
|
||||
|
||||
File packageFile = new File(path, filenameBase);
|
||||
File headersFile = new File(path, filenameBase + "-headers");
|
||||
|
Reference in New Issue
Block a user