1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 01:42:35 +01:00

Fixed: Ignore extra spaces in path when not running on Windows

(cherry picked from commit 6d0f10b877912edef21232c64339cc6548d9690e)
This commit is contained in:
Mark McDowall 2024-09-27 16:45:38 -07:00 committed by Bogdan
parent a81d27acda
commit 5893d88058

View File

@ -148,14 +148,14 @@ public static bool IsPathValid(this string path, PathValidationType validationTy
return false; return false;
} }
if (path.Trim() != path)
{
return false;
}
// Only check for leading or trailing spaces for path when running on Windows. // Only check for leading or trailing spaces for path when running on Windows.
if (OsInfo.IsWindows) if (OsInfo.IsWindows)
{ {
if (path.Trim() != path)
{
return false;
}
var directoryInfo = new DirectoryInfo(path); var directoryInfo = new DirectoryInfo(path);
while (directoryInfo != null) while (directoryInfo != null)