From ab04c491fd6cc53616be6035f7769b0741ba12ee Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Sun, 7 Jun 2020 15:54:08 +0300 Subject: [PATCH] Ignore case with room-specific wordfilter --- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 9079713e..5251c9b5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -85,6 +85,7 @@ import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; import java.util.stream.Collectors; public class Room implements Comparable, ISerialize, Runnable { @@ -3076,7 +3077,7 @@ public class Room implements Comparable, ISerialize, Runnable { if (!this.wordFilterWords.isEmpty()) { if (!habbo.hasPermission(Permission.ACC_CHAT_NO_FILTER)) { for (String string : this.wordFilterWords) { - roomChatMessage.setMessage(roomChatMessage.getMessage().replace(string, "bobba")); + roomChatMessage.setMessage(roomChatMessage.getMessage().replaceAll("(?i)" + Pattern.quote(string), "bobba")); } } }