summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts/safe-uri-decode.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-07-13 18:11:54 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-07-13 18:11:54 +0900
commitad970dffdabb7b81ee18583c86898f48df0b4302 (patch)
treeb5b1e7a40c377369a4dd364b1f86a99462a469a4 /packages/client/src/scripts/safe-uri-decode.ts
parent:art: (diff)
downloadsharkey-ad970dffdabb7b81ee18583c86898f48df0b4302.tar.gz
sharkey-ad970dffdabb7b81ee18583c86898f48df0b4302.tar.bz2
sharkey-ad970dffdabb7b81ee18583c86898f48df0b4302.zip
fix(client): fix url encoded string handling of nirax
Fix #8878
Diffstat (limited to 'packages/client/src/scripts/safe-uri-decode.ts')
-rw-r--r--packages/client/src/scripts/safe-uri-decode.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/client/src/scripts/safe-uri-decode.ts b/packages/client/src/scripts/safe-uri-decode.ts
new file mode 100644
index 0000000000..301b56d7fd
--- /dev/null
+++ b/packages/client/src/scripts/safe-uri-decode.ts
@@ -0,0 +1,7 @@
+export function safeURIDecode(str: string): string {
+ try {
+ return decodeURIComponent(str);
+ } catch {
+ return str;
+ }
+}