Skip to content

Commit

Permalink
Disallow illegal characters in chat (#258)
Browse files Browse the repository at this point in the history
* Disallow illegal characters in chat
  • Loading branch information
Commandcracker authored Nov 13, 2024
1 parent c2822f4 commit 060274b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pumpkin/src/client/player_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,12 @@ impl Player {
return;
}

// TODO: filter message & validation
if message.chars().any(|c| c == '§' || c < ' ' || c == '\x7F') {
self.kick(TextComponent::text("Illegal characters in chat"))
.await;
return;
}

let gameprofile = &self.gameprofile;
log::info!("<chat>{}: {}", gameprofile.name, message);

Expand Down

0 comments on commit 060274b

Please sign in to comment.