diff options
author | sekoia <sequoia.1009@gmail.com> | 2023-08-28 15:27:00 +0200 |
---|---|---|
committer | sekoia <sequoia.1009@gmail.com> | 2023-09-07 22:13:02 +0200 |
commit | bbeb2f98f553812e50645f35faf6cad157fbaa5a (patch) | |
tree | 5f78d8a903a46117183ead6411ffdb975eeb9408 /editor/scene_create_dialog.cpp | |
parent | 031f6deefb080d4d7634d8190334a7049f265146 (diff) | |
download | redot-engine-bbeb2f98f553812e50645f35faf6cad157fbaa5a.tar.gz |
Prevent creating any type of file with a leading dot
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: gotnospirit <gotnospirit@gmail.com>
Diffstat (limited to 'editor/scene_create_dialog.cpp')
-rw-r--r-- | editor/scene_create_dialog.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/scene_create_dialog.cpp b/editor/scene_create_dialog.cpp index aac9ca3739..fef78e5154 100644 --- a/editor/scene_create_dialog.cpp +++ b/editor/scene_create_dialog.cpp @@ -103,6 +103,8 @@ void SceneCreateDialog::update_dialog() { if (validation_panel->is_valid() && !scene_name.is_valid_filename()) { validation_panel->set_message(MSG_ID_PATH, TTR("File name invalid."), EditorValidationPanel::MSG_ERROR); + } else if (validation_panel->is_valid() && scene_name[0] == '.') { + validation_panel->set_message(MSG_ID_PATH, TTR("File name begins with a dot."), EditorValidationPanel::MSG_ERROR); } if (validation_panel->is_valid()) { |