mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 21:27:44 +02:00
improve invalid path name
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
(cherry picked from commit a7a1b28765
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
5934849d87
commit
8984cd5f66
@ -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
|
||||
|
@ -227,9 +227,7 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_t
|
||||
if (parent.contains("url")) {
|
||||
file.downloadUrl = Json::requireString(parent, "url");
|
||||
file.fileName = Json::requireString(parent, "filename");
|
||||
#ifdef Q_OS_WIN
|
||||
file.fileName = FS::RemoveInvalidPathChars(file.fileName);
|
||||
#endif
|
||||
file.is_preferred = Json::requireBoolean(parent, "primary") || (files.count() == 1);
|
||||
auto hash_list = Json::requireObject(parent, "hashes");
|
||||
|
||||
|
Reference in New Issue
Block a user