From 35fe931173e4846fc84cc538e992c47eb083dd57 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Sun, 22 Sep 2024 16:24:07 +0300 Subject: [PATCH] Fixes issue on Windows platform that was preventing file system names containing underscores (_) from being considered valid --- .../Strategies/Path/WindowsPathStrategy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Lumina.Domain/Core/Aggregates/FileManagement/FileManagementAggregate/Strategies/Path/WindowsPathStrategy.cs b/src/Lumina.Domain/Core/Aggregates/FileManagement/FileManagementAggregate/Strategies/Path/WindowsPathStrategy.cs index 02478794..ece8a564 100644 --- a/src/Lumina.Domain/Core/Aggregates/FileManagement/FileManagementAggregate/Strategies/Path/WindowsPathStrategy.cs +++ b/src/Lumina.Domain/Core/Aggregates/FileManagement/FileManagementAggregate/Strategies/Path/WindowsPathStrategy.cs @@ -52,7 +52,7 @@ public class WindowsPathStrategy : IWindowsPathStrategy return false; // regular expression to match valid absolute paths // this allows drive letters (e.g., C:\) and UNC paths (e.g., \\server\share) - var pathPattern = @"^[a-zA-Z]:\\(?:[a-zA-Z0-9\s().-]+\\)*[a-zA-Z0-9\s().-]*\\?$"; + var pathPattern = @"^[a-zA-Z]:\\(?:[a-zA-Z0-9\s()._-]+\\)*[a-zA-Z0-9\s()._-]*\\?$"; return Regex.IsMatch(path.Path, pathPattern); }