|
|
|
@ -155,16 +155,20 @@ namespace NzbDrone.Common.Extensions
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var directoryInfo = new DirectoryInfo(path);
|
|
|
|
|
|
|
|
|
|
while (directoryInfo != null)
|
|
|
|
|
// Only check for leading or trailing spaces for path when running on Windows.
|
|
|
|
|
if (OsInfo.IsWindows)
|
|
|
|
|
{
|
|
|
|
|
if (directoryInfo.Name.Trim() != directoryInfo.Name)
|
|
|
|
|
var directoryInfo = new DirectoryInfo(path);
|
|
|
|
|
|
|
|
|
|
while (directoryInfo != null)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (directoryInfo.Name.Trim() != directoryInfo.Name)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
directoryInfo = directoryInfo.Parent;
|
|
|
|
|
directoryInfo = directoryInfo.Parent;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (validationType == PathValidationType.AnyOs)
|
|
|
|
|