mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-10 07:14:36 +00:00
e4f4b4d310
The collapse matcher (which catches elongation bypasses like "niiigger") pre-collapses banned words by reducing every run of a repeated letter to one. That turns short slurs with a natural double letter into common substrings — "coons" -> "cons", "boong" -> "bong", "bussy" -> "busy", "nigger" -> "niger" — and since it substring-matches, those censor innocent names like console, icons, busy, Bongo, Nigeria, and negative. Against the live banned list this falsely censored ~half of ordinary test names. A collapse hit is only a genuine elongation bypass when the matched text actually repeats a letter. Filter collapse matches to keep only those whose span (widened one char each side, to catch a trailing collapsed duplicate such as "nigg" -> "nig") contains a repeated letter. This can only remove collapse matches, never add them: a canonically-spelled slur with no repeat equals its deduped pattern and is still caught by the literal substring matcher, so no real slur is lost. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>