Open Injabie3 opened 1 year ago
Regarding the particular RegEx pattern concerned, is it a pattern that we inserted into the cog? If the problem doesn't take place programmatically, then I'd see it as a human error and we need to fix the problematic patterns. Am I misunderstanding the issue post here?
This pattern was restored from a backup, so it was entered in by someone, but we should validate the pattern before adding it in.
Might be better to handle this without raising an exception; could log it in the console instead so as to keep it working
This pattern was restored from a backup, so it was entered in by someone, but we should validate the pattern before adding it in.
Would constructing a re.Pattern
object work? I'm not sure how we go about pattern validation. If anything, we should only put in good, valid patterns.
Might be better to handle this without raising an exception; could log it in the console instead so as to keep it working
Right. Some error log lines should definitely help.
In other cogs that hook into WordFilter, we hit a
multiple repeat
error on the following regex string:bl[o0]*{0,3}w j[o0]*{0,3}bs
. Of particular interest is the*
operator, which was what it was complaining about, because{0,3}
is trying to operate on*
which doesn't make sense.We should find a way to better handle this on insertion and within the
_filterWord
function.Logs below: