improve invalid path name

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
(cherry picked from commit a7a1b28765)
This commit is contained in:
Trial97 2024-05-30 13:49:23 +03:00 committed by github-actions[bot]
parent 5934849d87
commit 8984cd5f66
8 changed files with 82 additions and 20 deletions

View file

@ -239,9 +239,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