mirror of
https://github.com/godotengine/godot.git
synced 2025-10-24 10:23:28 +00:00
Prevent using name with leading dot when create/rename/duplicate scene/folder/script/resource
Fixes #62497
This commit is contained in:
parent
e22335ec72
commit
6782738a85
7 changed files with 47 additions and 6 deletions
|
|
@ -150,7 +150,15 @@ void EditorDirDialog::_make_dir_confirm() {
|
|||
|
||||
DirAccessRef d = DirAccess::open(dir);
|
||||
ERR_FAIL_COND_MSG(!d, "Cannot open directory '" + dir + "'.");
|
||||
Error err = d->make_dir(makedirname->get_text());
|
||||
|
||||
String dir_name = makedirname->get_text();
|
||||
if (dir_name.begins_with(".")) {
|
||||
mkdirerr->set_text(TTR("Could not use a name with a leading dot."));
|
||||
mkdirerr->popup_centered_minsize(Size2(250, 80) * EDSCALE);
|
||||
return;
|
||||
}
|
||||
|
||||
Error err = d->make_dir(dir_name);
|
||||
|
||||
if (err != OK) {
|
||||
mkdirerr->popup_centered_minsize(Size2(250, 80) * EDSCALE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue