chatfilter: fix matching lt/gt

These are encoded as <lt> and <gt> and so require the patterns to match those, which is unintuitive
This commit is contained in:
Adam
2022-06-06 20:14:26 -04:00
parent 0da4a65ce2
commit 8be3210b87
2 changed files with 14 additions and 1 deletions

View File

@@ -453,4 +453,15 @@ public class ChatFilterPluginTest
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(1, client.getIntStack()[client.getIntStackSize() - 3]); // not filtered
}
@Test
public void testLtGt()
{
when(chatFilterConfig.filteredWords()).thenReturn("f<ilte>r");
chatFilterPlugin.updateFilteredPatterns();
String message = chatFilterPlugin.censorMessage("Adam", "start f<lt>ilte<gt>r end");
assertEquals("start ******** end", message);
}
}