From 731aa3e31af1716589287fe85f0fea36c6e12fee Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Sat, 28 Sep 2024 14:33:36 -0500 Subject: [PATCH] Actions: decode URI components on encrypted usernames passed by Smogon --- src/actions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/actions.ts b/src/actions.ts index 95a07a1..23ea0af 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -937,7 +937,9 @@ export const actions: {[k: string]: QueryHandler} = { if (!params.encrypted_name || !toID(params.encrypted_name)) { throw new ActionError("No encrypted name provided."); } - return {decrypted_name: decrypt(SMOGON_KEY, params.encrypted_name)}; + return { + decrypted_name: decrypt(SMOGON_KEY, decodeURIComponent(params.encrypted_name)), + }; }, };