Skip to content

Commit

Permalink
Actions: decode URI components on encrypted usernames passed by Smogon
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Sep 28, 2024
1 parent 7ce47cc commit 731aa3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
};
},
};

Expand Down

0 comments on commit 731aa3e

Please sign in to comment.