mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-09 21:34:20 +00:00
Migrate away from unsafe function
MooTools More has CVE-2021-20088 and qbt is affected by it by using the unsafe function call `String.parseQueryString()`, so migrate away from it. PR #18554.
This commit is contained in:
parent
3fea9f5a33
commit
6a4bb5c1b7
@ -1387,11 +1387,11 @@ function registerMagnetHandler() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashParams = getHashParamsFromUrl();
|
const hashString = location.hash ? location.hash.replace(/^#/, '') : '';
|
||||||
hashParams.download = '';
|
const hashParams = new URLSearchParams(hashString);
|
||||||
|
hashParams.set('download', '');
|
||||||
const templateHashString = Object.toQueryString(hashParams).replace('download=', 'download=%s');
|
|
||||||
|
|
||||||
|
const templateHashString = hashParams.toString().replace('download=', 'download=%s');
|
||||||
const templateUrl = location.origin + location.pathname
|
const templateUrl = location.origin + location.pathname
|
||||||
+ location.search + '#' + templateHashString;
|
+ location.search + '#' + templateHashString;
|
||||||
|
|
||||||
@ -1411,11 +1411,6 @@ function handleDownloadParam() {
|
|||||||
showDownloadPage([url]);
|
showDownloadPage([url]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHashParamsFromUrl() {
|
|
||||||
const hashString = location.hash ? location.hash.replace(/^#/, '') : '';
|
|
||||||
return (hashString.length > 0) ? String.parseQueryString(hashString) : {};
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeWindows() {
|
function closeWindows() {
|
||||||
MochaUI.closeAll();
|
MochaUI.closeAll();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user