Fixed being able to bypass replacement filters by having multiple of the same match in one string
This commit is contained in:
parent
dac0f7936e
commit
3e313cb00b
|
|
@ -76,7 +76,7 @@ public class ChatFilter {
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
String group = matcher.group(); // todo debug
|
String group = matcher.group(); // todo debug
|
||||||
if (getExclusions().stream().noneMatch(s -> s.equalsIgnoreCase(group))) { // idk how heavy this is:/
|
if (getExclusions().stream().noneMatch(s -> s.equalsIgnoreCase(group))) { // idk how heavy this is:/
|
||||||
modifiableString.string(input.replace(group, getReplacement()));
|
modifiableString.replace(group, getReplacement());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ public class ModifiableString {
|
||||||
this.string = string;
|
this.string = string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void replace(String match, String replace) {
|
||||||
|
this.string = string.replaceAll(match, replace);
|
||||||
|
}
|
||||||
|
|
||||||
public String string() {
|
public String string() {
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user