Prevent using name with leading dot when create/rename/duplicate scene/folder/script/resource

Fixes #62497
This commit is contained in:
James 2022-07-12 15:51:18 +08:00
parent e22335ec72
commit 6782738a85
7 changed files with 47 additions and 6 deletions

View file

@ -169,6 +169,9 @@ String ScriptCreateDialog::_validate_path(const String &p_path, bool p_file_must
if (p.get_file().get_basename() == "") {
return TTR("Filename is empty.");
}
if (p.get_file().begins_with(".")) {
return TTR("Name begins with a dot.");
}
p = ProjectSettings::get_singleton()->localize_path(p);
if (!p.begins_with("res://")) {