Compare commits

...

2 Commits

Author SHA1 Message Date
Chocobo1
fef6ac515c Use source URL for search plugins
This saves a few URL redirections. And avoids potential issues related to Cloudflare
protections/blockages on qbt domain.

Closes #22990.
PR #23048.
2025-08-03 15:16:57 +08:00
Chocobo1
94552b2384 WebUI: use secure random number generator for generating random port
Cryptographically strong random number generators are generally preferred over others.

PR #23049.
2025-08-03 15:09:39 +08:00
2 changed files with 6 additions and 4 deletions

View File

@@ -87,7 +87,7 @@ namespace
QPointer<SearchPluginManager> SearchPluginManager::m_instance = nullptr;
SearchPluginManager::SearchPluginManager()
: m_updateUrl(u"https://searchplugins.qbittorrent.org/nova3/engines/"_s)
: m_updateUrl(u"https://raw.githubusercontent.com/qbittorrent/search-plugins/refs/heads/master/nova3/engines/"_s)
, m_proxyEnv {QProcessEnvironment::systemEnvironment()}
{
Q_ASSERT(!m_instance); // only one instance is allowed

View File

@@ -2127,9 +2127,11 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
};
const generateRandomPort = () => {
const min = 1024;
const max = 65535;
const port = Math.floor(Math.random() * (max - min + 1) + min);
// don't use modulo operations to avoid 'modulo bias'
const buffer = new Uint16Array(1);
let port = crypto.getRandomValues(buffer)[0];
while (port < 1024)
port = crypto.getRandomValues(buffer)[0];
document.getElementById("portValue").value = port;
};