-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Restrict the project data directory configuration #53779
[3.x] Restrict the project data directory configuration #53779
Conversation
0c4f70e
to
e14ee7f
Compare
@@ -1990,7 +1990,8 @@ Error EditorFileSystem::_resource_import(const String &p_path) { | |||
} | |||
|
|||
bool EditorFileSystem::_should_skip_directory(const String &p_path) { | |||
if (p_path.begins_with(ProjectSettings::get_singleton()->get_project_data_path())) { | |||
String project_data_path = ProjectSettings::get_singleton()->get_project_data_path(); | |||
if (p_path == project_data_path || p_path.begins_with(project_data_path + "/")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were right about ==
problem here and begins_with with concatenated "/" should cover what we wanted to achieve, no need to do both (or I'm missing something here again, I've just tried debugging it and p_path always includes slash at the end).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to cover the case where p_path
didn't include slash at the end.
If it's guaranteed to always include a /
at the end, I can remove the ==
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's possible for the p_path
to not have a trailing slash when this function is invoked.
See
godot/editor/editor_export.cpp
Line 446 in 2b5d89e
if (EditorFileSystem::_should_skip_directory(cur_dir + dir)) { |
cur_dir
is the root directory (e.g: res://
).
Please also review The MRP covering edge cases would be appreciated. |
This change was made in godot/editor/editor_file_dialog.cpp Line 591 in d956904
String(item_meta["path"]).begins_with("res://.godot") .
|
e14ee7f
to
2b6678c
Compare
Thanks! |
Limits the configuration range for the project data directory.