From f3e5b1a9c280a7bab4d894f0efad0a0dad073e24 Mon Sep 17 00:00:00 2001 From: Dave Hoover Date: Sat, 2 May 2009 06:29:40 +0000 Subject: [PATCH] We don't need to make _stopMatcher match the entire content of the text that contains the stop word since the filter only cares if it exists at all in the text. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5766 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/crowd/chat/client/CurseFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/crowd/chat/client/CurseFilter.java b/src/java/com/threerings/crowd/chat/client/CurseFilter.java index fb4aa3103..add5e86f5 100644 --- a/src/java/com/threerings/crowd/chat/client/CurseFilter.java +++ b/src/java/com/threerings/crowd/chat/client/CurseFilter.java @@ -188,13 +188,13 @@ public abstract class CurseFilter implements ChatFilter String pattern = ""; while (st.hasMoreTokens()) { if ("".equals(pattern)) { - pattern += ".*("; + pattern += "("; } else { pattern += "|"; } pattern += "\\b" + StringUtil.replace(st.nextToken(), "*", "[A-Za-z]*") + "\\b"; } - pattern += ").*"; + pattern += ")"; Pattern pat = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE); _stopMatcher = pat.matcher("");