You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Fix decoding UTF-8 filenames on unzipping.
(cherry picked from commit d2573c1636)
This commit is contained in:
@@ -204,7 +204,7 @@ private:
|
||||
char fname[16384];
|
||||
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
|
||||
|
||||
if (String(fname).ends_with("project.godot")) {
|
||||
if (String::utf8(fname).ends_with("project.godot")) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ private:
|
||||
char fname[16384];
|
||||
unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
|
||||
|
||||
String name = fname;
|
||||
String name = String::utf8(fname);
|
||||
if (name.ends_with("project.godot")) {
|
||||
zip_root = name.substr(0, name.rfind("project.godot"));
|
||||
break;
|
||||
@@ -534,7 +534,7 @@ private:
|
||||
char fname[16384];
|
||||
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
|
||||
|
||||
String path = fname;
|
||||
String path = String::utf8(fname);
|
||||
|
||||
if (path == String() || path == zip_root || !zip_root.is_subsequence_of(path)) {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user