mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Correctly detect trackers with invalid TLDs or IPv4/IPv6 addresses.
This commit is contained in:
parent
e378f28fb7
commit
6c579950f6
1 changed files with 4 additions and 0 deletions
|
@ -718,6 +718,10 @@ QString TrackerFiltersList::getHost(const QString &trakcer) const
|
|||
QUrl url(trakcer);
|
||||
QString longHost = url.host();
|
||||
QString tld = url.topLevelDomain();
|
||||
// We get empty tld when it is invalid or an IPv4/IPv6 address,
|
||||
// so just return the full host
|
||||
if (tld.isEmpty())
|
||||
return longHost;
|
||||
// We want the domain + tld. Subdomains should be disregarded
|
||||
int index = longHost.lastIndexOf('.', -(tld.size() + 1));
|
||||
if (index == -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue