private string TryValidateOldUrl(string url)
{
if (string.IsNullOrWhiteSpace(url))
{
return null;
}
url = urlService.FixUrl(url);
if (!urlService.ValidateInternalUrl(url))
{
var serverPath = httpContextAccessor.MapPublicPath("/").TrimEnd('/');
if (url.StartsWith(serverPath) && serverPath != url)
{
url = url.Substring(serverPath.Length, url.Length - serverPath.Length);
if (!urlService.ValidateInternalUrl(url))
{
return null;
}
}
else
{
return null;
}
}
return url;
}