mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-05 09:10:53 +01:00
Fix mobile +
url encoding issue (#1510)
This commit is contained in:
parent
7d018e4b59
commit
6e8c15bccd
@ -45,7 +45,7 @@ async function start() {
|
||||
|
||||
let decodedData: any;
|
||||
try {
|
||||
decodedData = JSON.parse(b64Decode(data));
|
||||
decodedData = JSON.parse(b64Decode(data, true));
|
||||
} catch (e) {
|
||||
error("Cannot parse data.");
|
||||
return;
|
||||
|
@ -15,7 +15,11 @@ export function getQsParam(name: string) {
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
export function b64Decode(str: string) {
|
||||
export function b64Decode(str: string, spaceAsPlus = false) {
|
||||
if (spaceAsPlus) {
|
||||
str = str.replace(/ /g, "+");
|
||||
}
|
||||
|
||||
return decodeURIComponent(
|
||||
Array.prototype.map
|
||||
.call(atob(str), (c: string) => {
|
||||
|
Loading…
Reference in New Issue
Block a user