mirror of
https://github.com/TotalFreedomMC/BukkitTelnet.git
synced 2024-06-25 23:41:01 +00:00
fixed regex
This commit is contained in:
parent
879ecfd279
commit
33f7d9c7b6
|
@ -34,7 +34,7 @@ public class TelnetListener extends Handler implements CommandSender
|
|||
MCTelnet parent;
|
||||
String ip;
|
||||
String passRegex = "[^a-zA-Z0-9\\-\\.\\_]";
|
||||
String commandRegex = "[^a-zA-Z0-9 \\-\\.\\_\\\"]";
|
||||
String commandRegex = "[^\\x20-\\x7E§]";
|
||||
|
||||
public TelnetListener(Socket inSock, MCTelnet iparent)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ public class TelnetListener extends Handler implements CommandSender
|
|||
clientSocket = inSock;
|
||||
parent = iparent;
|
||||
passRegex = parent.getConfiguration().getString("passwordRegex", passRegex);
|
||||
commandRegex = parent.getConfiguration().getString("commandRegex", commandRegex);
|
||||
//commandRegex = parent.getConfiguration().getString("commandRegex", commandRegex);
|
||||
ip = clientSocket.getInetAddress().toString();
|
||||
listenThread = new Thread(new Runnable()
|
||||
{
|
||||
|
@ -170,7 +170,7 @@ public class TelnetListener extends Handler implements CommandSender
|
|||
while (run && clientSocket.isConnected() && isAuth)
|
||||
{
|
||||
String command = "";
|
||||
command = instream.readLine().replaceAll(commandRegex, "");
|
||||
command = instream.readLine().replaceAll(commandRegex, "").trim();
|
||||
if (command.equals("exit"))
|
||||
{
|
||||
run = false;
|
||||
|
|
Loading…
Reference in a new issue