Explicitely disallow \ for in filename

This commit is contained in:
nicolas.dorier 2021-03-19 20:22:24 +09:00
parent 779f21a1ca
commit 9b24e9378f
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
2 changed files with 4 additions and 3 deletions

View file

@ -3125,9 +3125,9 @@ namespace BTCPayServer.Tests
{
("test.com", true),
("/test.com", false),
("\\test.com", false),
("te\\st.com", false),
("te/st.com", false),
("\\test.com", false),
("te\\st.com", false)
};
foreach(var t in tests)
{

View file

@ -51,7 +51,8 @@ namespace BTCPayServer
return !fileName.ToCharArray().Any(c => Path.GetInvalidFileNameChars().Contains(c)
|| c == Path.AltDirectorySeparatorChar
|| c == Path.DirectorySeparatorChar
|| c == Path.PathSeparator);
|| c == Path.PathSeparator
|| c == '\\');
}
public static bool IsSafe(this LightningConnectionString connectionString)