mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Validate custom directory when project is started
This commit is contained in:
parent
8bd9cdeea6
commit
9977abd697
3 changed files with 32 additions and 1 deletions
|
|
@ -254,7 +254,7 @@ String OS::get_safe_dir_name(const String &p_dir_name, bool p_allow_paths) const
|
|||
if (p_allow_paths) {
|
||||
// Dir separators are allowed, but disallow ".." to avoid going up the filesystem
|
||||
invalid_chars.push_back("..");
|
||||
safe_dir_name = safe_dir_name.replace("\\", "/").strip_edges();
|
||||
safe_dir_name = safe_dir_name.replace("\\", "/").replace("//", "/").strip_edges();
|
||||
} else {
|
||||
invalid_chars.push_back("/");
|
||||
invalid_chars.push_back("\\");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue