Fixed blank lines in banned words file issues.

Blank lines resulted in lots of chat being muted which shouldn't have
been.
This commit is contained in:
ryanhamshire 2015-12-15 13:38:33 -08:00
parent 3611c09e7d
commit 41401abfaf

View File

@ -15,7 +15,10 @@ class WordFinder
StringBuilder patternBuilder = new StringBuilder();
for(String word : wordsToFind)
{
patternBuilder.append("|(([^\\w]|^)" + Pattern.quote(word) + "([^\\w]|$))");
if(!word.isEmpty() && !word.trim().isEmpty())
{
patternBuilder.append("|(([^\\w]|^)" + Pattern.quote(word) + "([^\\w]|$))");
}
}
String patternString = patternBuilder.toString();