mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Recognise v2 info-hashes in clipboard for "Add torrent link" dialog (#15206)
This commit is contained in:
parent
7974b5a95c
commit
aa8f420681
1 changed files with 6 additions and 2 deletions
|
@ -49,8 +49,12 @@ namespace
|
||||||
|| str.startsWith("https://", Qt::CaseInsensitive)
|
|| str.startsWith("https://", Qt::CaseInsensitive)
|
||||||
|| str.startsWith("ftp://", Qt::CaseInsensitive)
|
|| str.startsWith("ftp://", Qt::CaseInsensitive)
|
||||||
|| str.startsWith("magnet:", Qt::CaseInsensitive)
|
|| str.startsWith("magnet:", Qt::CaseInsensitive)
|
||||||
|| ((str.size() == 40) && !str.contains(QRegularExpression("[^0-9A-Fa-f]")))
|
|| ((str.size() == 40) && !str.contains(QRegularExpression("[^0-9A-Fa-f]"))) // v1 hex-encoded SHA-1 info-hash
|
||||||
|| ((str.size() == 32) && !str.contains(QRegularExpression("[^2-7A-Za-z]"))));
|
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||||
|
|| ((str.size() == 64) && !str.contains(QRegularExpression("[^0-9A-Fa-f]"))) // v2 hex-encoded SHA-256 info-hash
|
||||||
|
#endif
|
||||||
|
|| ((str.size() == 32) && !str.contains(QRegularExpression("[^2-7A-Za-z]")))); // v1 Base32 encoded SHA-1 info-hash
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue