mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-20 13:34:37 +01:00
Explicitely disallow \ for in filename
This commit is contained in:
parent
779f21a1ca
commit
9b24e9378f
2 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue