Reject blank directory names

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Jack Ye 2025-09-28 11:49:28 +08:00 committed by GitHub
parent e206f4f31c
commit 93d9667c04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -393,6 +393,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
/// </summary>
public static bool IsValidDirectoryName(string name)
{
if (string.IsNullOrWhiteSpace(name)) return false;
if (IsReservedName(name)) return false;
var invalidChars = Path.GetInvalidPathChars().Concat(new[] { '/', '\\' }).ToArray();
if (name.IndexOfAny(invalidChars) >= 0)