Merge pull request #81075 from SekoiaTree/prevent-leading-dot

Prevent creating any type of file with a leading dot
This commit is contained in:
Rémi Verschelde 2023-09-08 09:10:59 +02:00
commit 119f379a3d
No known key found for this signature in database
GPG key ID: C3336907360768E1
4 changed files with 19 additions and 4 deletions

View file

@ -244,6 +244,9 @@ String ScriptCreateDialog::_validate_path(const String &p_path, bool p_file_must
if (!p.get_file().get_basename().is_valid_filename()) {
return TTR("Filename is invalid.");
}
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://")) {