diff --git a/core/os/os.cpp b/core/os/os.cpp index 1aee6d9aa2e..e745578085c 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -306,6 +306,15 @@ String OS::get_system_dir(SystemDir p_dir) const { return "."; } +String OS::get_safe_application_name() const { + String an = Globals::get_singleton()->get("application/name"); + Vector invalid_char = String("\\ / : * ? \" < > |").split(" "); + for (int i=0;iget("application/name"); + String an = get_safe_application_name(); if (an!="") { diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 7f5f40b3a05..5cc1c868f76 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2107,7 +2107,7 @@ String OS_Windows::get_system_dir(SystemDir p_dir) const { } String OS_Windows::get_data_dir() const { - String an = Globals::get_singleton()->get("application/name"); + String an = get_safe_application_name(); if (an!="") { if (has_environment("APPDATA")) {