Added a check for trailing dot when creating folder.

Merge the trailing dot test into existing test. Removed OS test.

(cherry picked from commit 96f61b2d65)
This commit is contained in:
Felix Yang 2018-03-04 10:47:08 +01:00 committed by Hein-Pieter van Braam
parent 8da76f3bb8
commit 12336dc253
1 changed files with 1 additions and 1 deletions

View File

@ -917,7 +917,7 @@ void FileSystemDock::_make_dir_confirm() {
if (dir_name.length() == 0) { if (dir_name.length() == 0) {
EditorNode::get_singleton()->show_warning(TTR("No name provided")); EditorNode::get_singleton()->show_warning(TTR("No name provided"));
return; return;
} else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1) { } else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.ends_with(".")) {
EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters")); EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters"));
return; return;
} }