mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 06:20:34 +00:00
Resolve CA5389
This commit is contained in:
@@ -115,7 +115,6 @@ dotnet_diagnostic.ca1028.severity = silent
|
||||
dotnet_diagnostic.ca1031.severity = silent
|
||||
|
||||
# TODO - one at a time
|
||||
dotnet_diagnostic.ca5389.severity = silent
|
||||
dotnet_diagnostic.ca5392.severity = silent
|
||||
dotnet_diagnostic.ca5394.severity = silent
|
||||
|
||||
|
||||
@@ -1004,7 +1004,11 @@ namespace ArchiSteamFarm {
|
||||
|
||||
// Now enumerate over files in the zip archive, skip directory entries that we're not interested in (we can create them ourselves if needed)
|
||||
foreach (ZipArchiveEntry zipFile in archive.Entries.Where(zipFile => !string.IsNullOrEmpty(zipFile.Name))) {
|
||||
string file = Path.Combine(targetDirectory, zipFile.FullName);
|
||||
string file = Path.GetFullPath(Path.Combine(targetDirectory, zipFile.FullName));
|
||||
|
||||
if (!file.StartsWith(targetDirectory, StringComparison.Ordinal)) {
|
||||
throw new InvalidOperationException(nameof(file));
|
||||
}
|
||||
|
||||
if (File.Exists(file)) {
|
||||
// This is possible only with files that we decided to leave in place during our backup function
|
||||
|
||||
Reference in New Issue
Block a user