mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 02:38:28 +00:00
parseQueryString: switch to URLSearchParams and remove unused param (#3340)
This commit is contained in:
@@ -530,16 +530,9 @@ function getCSSval(cssclass, cssproperty) {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseQueryString(queryString = globalThis.location.search) {
|
function parseQueryString() {
|
||||||
const GETDict = {};
|
const params = new URLSearchParams(globalThis.location.search);
|
||||||
queryString
|
return Object.fromEntries(params.entries());
|
||||||
.substr(1)
|
|
||||||
.split("&")
|
|
||||||
.forEach(function (item) {
|
|
||||||
GETDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1]);
|
|
||||||
});
|
|
||||||
|
|
||||||
return GETDict;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://stackoverflow.com/q/21647928
|
// https://stackoverflow.com/q/21647928
|
||||||
|
|||||||
Reference in New Issue
Block a user