fix: Replace RE2 with RegExp for "mute word" regex validation (resolves #850)
All threads resolved!
All threads resolved!
Replaces RE2
with RegExp
in the validateMuteWordRegex
function. This should allow the full range of regex features to be used, such as negative lookahead. For example, the word mute /test(?!osterone)/i
should now no longer throw an error, and should match "test" but not "testosterone".
Previously, regex word mutes were limited by the RE2 implementation, to avoid expensive computation on the server side. However, according to @dakkar, this should no longer be necessary. See #850 (closed) for further details.
I've tested that negative lookahead functions properly with this change applied. I have not tested whether this change might open up a risk of malicious expressions with exponential runtime running on the server, since I couldn't find any usable examples. This MR assumes that @dakkar's conclusions in #850 (closed) were correct (and that I've interpreted them correctly.)
By submitting this merge request, you agree to follow our Contribution Guidelines