Fix URL-encoded equals sign in datalink
This commit is contained in:
parent
1b21b872bd
commit
265a23250c
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue