Skip to content

Commit

Permalink
party: sanitize passphrase inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jun 21, 2022
1 parent a9d89f0 commit 73116f3
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,19 @@ class PartyPanel extends PluginPanel
return;
}

for (int i = 0; i < s.length(); ++i)
{
char ch = s.charAt(i);
if (!Character.isLetter(ch) && !Character.isDigit(ch) && ch != '-')
{
JOptionPane.showMessageDialog(joinPartyButton,
"Party passphrase must be a combination of alphanumeric or hyphen characters.",
"Invalid party passphrase",
JOptionPane.ERROR_MESSAGE);
return;
}
}

party.changeParty(s);
}
});
Expand Down

0 comments on commit 73116f3

Please sign in to comment.