Fixed filter bypass

This commit is contained in:
Jonathan Williams 2014-07-19 13:53:14 -07:00
parent 3636255e8a
commit 8b747a81e1

View File

@ -191,10 +191,11 @@ public class Chat extends MiniPlugin
{ {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
final String plyrname = player.toString(); final String plyrname = player.toString();
final String msg = event.getMessage(); final String msg = event.getMessage().replaceAll("[^\\x00-\\x7F]", "").trim();
final String filtertype = "chat"; final String filtertype = "chat";
final String dname = player.getPlayerListName(); final String dname = player.getPlayerListName();
JSONObject message = buildJsonChatObject(filtertype, dname, plyrname, msg, _serverName, 1); JSONObject message = buildJsonChatObject(filtertype, dname, plyrname, msg, _serverName, 1);
String response = getResponseFromTwoHat(message, filtertype); String response = getResponseFromTwoHat(message, filtertype);
@ -208,7 +209,7 @@ public class Chat extends MiniPlugin
if (risk >= 5) if (risk >= 5)
{ {
String filteredMessage = event.getMessage(); String filteredMessage = event.getMessage().replaceAll("[^\\x00-\\x7F]", "").trim();
if (parseHashes(response) == null) if (parseHashes(response) == null)
event.setMessage(ChatColor.RED + msg); event.setMessage(ChatColor.RED + msg);