Duplicate Regexp check removed, and now we check if password different

from username
This commit is contained in:
Xephi59 2015-06-28 02:06:51 +02:00
parent 8e010d467c
commit ac543df216
2 changed files with 2 additions and 7 deletions

View File

@ -58,7 +58,7 @@ public class ChangePasswordCommand implements CommandExecutor {
m.send(player, "password_error");
return true;
}
if (!args[1].matches(Settings.getPassRegex)) {
if (lowpass.equalsIgnoreCase(name)) {
m.send(player, "password_error");
return true;
}

View File

@ -52,12 +52,7 @@ public class AsyncronousRegister {
allowRegister = false;
}
else if (!password.matches(Settings.getPassRegex)) {
m.send(player, "password_error");
allowRegister = false;
}
else if ((lowpass.contains("delete") || lowpass.contains("where") || lowpass.contains("insert") || lowpass.contains("modify") || lowpass.contains("from") || lowpass.contains("select") || lowpass.contains(";") || lowpass.contains("null")) || !lowpass.matches(Settings.getPassRegex)) {
else if ((lowpass.equalsIgnoreCase(player.getName()) || lowpass.contains("delete") || lowpass.contains("where") || lowpass.contains("insert") || lowpass.contains("modify") || lowpass.contains("from") || lowpass.contains("select") || lowpass.contains(";") || lowpass.contains("null")) || !lowpass.matches(Settings.getPassRegex)) {
m.send(player, "password_error");
allowRegister = false;
}