mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
filter invalid chars
This commit is contained in:
parent
1a1d50b036
commit
da0d6eecb5
1 changed files with 10 additions and 0 deletions
|
@ -984,6 +984,11 @@ class FileUtilSandboxed
|
|||
path = path.substring(1);
|
||||
}
|
||||
|
||||
for (char in INVALID_CHARS)
|
||||
{
|
||||
path = path.replace(char, '');
|
||||
}
|
||||
|
||||
var parts:Array<String> = path.split('/');
|
||||
var sanitized:Array<String> = [];
|
||||
for (part in parts)
|
||||
|
@ -1020,6 +1025,11 @@ class FileUtilSandboxed
|
|||
'lime.ndll'
|
||||
];
|
||||
|
||||
/**
|
||||
* Characters which are invalid in the file system.
|
||||
*/
|
||||
private static final INVALID_CHARS:Array<String> = [':', '*', '?', '"', '<', '>', '|'];
|
||||
|
||||
/**
|
||||
* Check against protected paths.
|
||||
* @param path The path to check.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue