Merge pull request #2425 from Trial97/win_char

improve invalid path name
This commit is contained in:
Alexandru Ionut Tripon
2024-06-10 12:11:21 +03:00
committed by GitHub
8 changed files with 62 additions and 20 deletions

View File

@ -241,9 +241,7 @@ bool ModrinthCreationTask::createInstance()
for (auto file : m_files) {
auto fileName = file.path;
#ifdef Q_OS_WIN
fileName = FS::RemoveInvalidPathChars(fileName);
#endif
auto file_path = FS::PathCombine(root_modpack_path, fileName);
if (!root_modpack_url.isParentOf(QUrl::fromLocalFile(file_path))) {
// This means we somehow got out of the root folder, so abort here to prevent exploits