Fix URL-encoded equals sign in datalink

This commit is contained in:
Glitchii 2022-03-14 16:24:52 +00:00
parent 1b21b872bd
commit 265a23250c

View file

@ -29,9 +29,10 @@ var params = new URL(location).searchParams,
data = btoa(escape((JSON.stringify(typeof jsonCode === 'object' ? jsonCode : json)))); data = btoa(escape((JSON.stringify(typeof jsonCode === 'object' ? jsonCode : json))));
if (withURL) { if (withURL) {
let currentURL = new URL(location); let currentURL = new URL(location);
currentURL.searchParams.append('data', data.replace(/%3D/g, '=')); currentURL.searchParams.append('data', data);
if (redirect) window.location = currentURL; if (redirect) window.location = currentURL;
data = currentURL.href; // Replace %3D ('=' url encoded) with '='
data = currentURL.href.replace(/data=\w+(?:%3D)+/g, 'data=' + data);
} }
return data; return data;
}, },