mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
#1575 - Fix invalid URL handling
This commit is contained in:
@@ -137,12 +137,8 @@ namespace Jackett.Indexers
|
|||||||
if (!configData.SiteLink.Value.EndsWith("/", StringComparison.Ordinal))
|
if (!configData.SiteLink.Value.EndsWith("/", StringComparison.Ordinal))
|
||||||
configData.SiteLink.Value += "/";
|
configData.SiteLink.Value += "/";
|
||||||
|
|
||||||
var match = Regex.Match(configData.SiteLink.Value, "^https?:\\/\\/[\\w\\-\\/\\.]+$");
|
// check whether the site link is well-formatted
|
||||||
if (!match.Success)
|
var siteUri = new Uri(configData.SiteLink.Value);
|
||||||
{
|
|
||||||
throw new Exception(string.Format("\"{0}\" is not a valid URL.", configData.SiteLink.Value));
|
|
||||||
}
|
|
||||||
|
|
||||||
SiteLink = configData.SiteLink.Value;
|
SiteLink = configData.SiteLink.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user