mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
Fix mobile + url encoding issue (#1510)
This commit is contained in:
@@ -45,7 +45,7 @@ async function start() {
|
|||||||
|
|
||||||
let decodedData: any;
|
let decodedData: any;
|
||||||
try {
|
try {
|
||||||
decodedData = JSON.parse(b64Decode(data));
|
decodedData = JSON.parse(b64Decode(data, true));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error("Cannot parse data.");
|
error("Cannot parse data.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ export function getQsParam(name: string) {
|
|||||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
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(
|
return decodeURIComponent(
|
||||||
Array.prototype.map
|
Array.prototype.map
|
||||||
.call(atob(str), (c: string) => {
|
.call(atob(str), (c: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user