Fixed log entry for PatchFileXX options

(also allow using ".\\", as it cannot escape the game folder.)
This commit is contained in:
NovaRain
2024-01-11 21:38:58 +08:00
parent bfbbc339d0
commit 9e4ac57775
+2 -4
View File
@@ -279,9 +279,7 @@ static bool NormalizePath(std::string &path) {
path.erase(0, path.find_first_not_of('\\'));
// Disallow paths trying to "escape" game folder:
if (path.find(':') != std::string::npos ||
path.find(".\\") != std::string::npos ||
path.find("..\\") != std::string::npos) {
if (path.find(':') != std::string::npos || path.find("..\\") != std::string::npos) {
return false;
}
return !path.empty();
@@ -324,7 +322,7 @@ static void GetExtraPatches() {
for (int i = 0; i < 100; i++) {
_itoa(i, &patchFile[9], 10);
auto patch = IniReader::GetConfigString("ExtraPatches", patchFile, "");
if (!ValidateExtraPatch(patch, "", patchFile)) continue;
if (!ValidateExtraPatch(patch, ".\\", patchFile)) continue;
patchFiles.push_back(patch);
}
const std::string modsPath = ".\\mods\\";