SFUAnime/Ren

[WordFilter] Fix `_isAllFiltered` regex

Injabie3 opened this issue · 0 comments

This helper function is supposed to return True if everything is filtered (i.e. all asterisks). Its implementation is incorrect as it doesn't take into account word borders:

Current regex is:

[*]+

We expect the following results:

  1. **** ******* => True.
  2. **** ***cool** **stuff** **man** => False

Unfortunately, (2) returns True instead of False in the current implementation.

We should change the regex to the following and use the multiline flag:

^\*+$