fix: 当缺少某个文件夹时,GetFolderPath 会返回空字符串,导致安全检查异常(close Meloong-Git/PCL#8636,@qwer154899)
This commit is contained in:
1 parent
19541cecce
commit
04e7c56ba7
2 files changed
+3
-2
No files matched your search
@@ -101,7 +101,7 @@ public static class CryptographyUtils {
|
|||||||
#region ECDSA
|
#region ECDSA
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 未指定公钥时使用的默认 ECDSA P-256 公钥。
|
/// 未指定公钥时的默认 ECDSA P-256 公钥。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string defaultEcdsaPublicKey = "RUNTMSAAAAC4QTUNAewh23Q4Q6koHkyIrDIIZUSbua23sf2DiZmIRwSzadISDRyTVTbuWniH3KR7rKj8XBsabms1be6i3c+S";
|
public static string defaultEcdsaPublicKey = "RUNTMSAAAAC4QTUNAewh23Q4Q6koHkyIrDIIZUSbua23sf2DiZmIRwSzadISDRyTVTbuWniH3KR7rKj8XBsabms1be6i3c+S";
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ public static class DirectoryUtils {
|
|||||||
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
|
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
|
||||||
Environment.GetFolderPath(Environment.SpecialFolder.Windows),
|
Environment.GetFolderPath(Environment.SpecialFolder.Windows),
|
||||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads") // 下载文件夹没有 SpecialFolder 枚举
|
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads") // 下载文件夹没有 SpecialFolder 枚举
|
||||||
}.Select(f => PathUtils.ForCompare(f))));
|
}.Where(f => f.Contains(Path.VolumeSeparatorChar)) // 当缺少某个文件夹时,GetFolderPath 会返回空字符串(#8636)
|
||||||
|
.Select(f => PathUtils.ForCompare(f))));
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user