#3133: Directly disconnect on illegal chars
This commit is contained in:
parent
f9583a7652
commit
15b39887c5
@ -147,7 +147,12 @@ public class UpstreamBridge extends PacketHandler
|
||||
for ( int index = 0, length = chat.getMessage().length(); index < length; index++ )
|
||||
{
|
||||
char c = chat.getMessage().charAt( index );
|
||||
Preconditions.checkArgument( c != '\u00A7' && c >= ' ' && c != 127, "illegal characters in chat" ); // Section symbol, control sequences, and delete
|
||||
// Section symbol, control sequences, and delete
|
||||
if ( c == '\u00A7' || c < ' ' || c == 127 )
|
||||
{
|
||||
con.disconnect( bungee.getTranslation( "illegal_chat_characters", String.format( "\\u%04x", (int) c ) ) );
|
||||
throw CancelSendSignal.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() );
|
||||
|
@ -39,3 +39,4 @@ you_got_summoned=\u00a76Summoned to {0} by {1}
|
||||
command_perms_groups=\u00a76You have the following groups: {0}
|
||||
command_perms_permission=\u00a79- {0}
|
||||
command_ip=\u00a79IP of {0} is {1}
|
||||
illegal_chat_characters=\u00a7cillegal characters in chat ({0})
|
||||
|
Loading…
Reference in New Issue
Block a user