You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, removing the quotes and leaving just the whitespace (4 spaces on each line) still results in the unexpected censoring. If you delete any of these spaces, no censoring occurs.
The error seems to be in the whitelisted term matching logic. In particular, we are using an index into the original input where we should instead be using an index to the transformed input, resulting in the second assa to be skipped over*. The following diff seems to fix it, if this is urgent for you:
I will hold off on a patch release until I have time to look at this more carefully, though. The matching logic is fairly complex and I would like to refamiliarize myself with the implementation to ensure this is fully correct first (particularly in cases with non-ASCII characters.) Unfortunately, as I said in #46, this may have to wait until late this month or early February. Apologies.
*I verified that there is no security issue with OOB access due to this mismatch--it should be purely a matter of correctness.
Expected behavior
When I input the following string:
I expect that there should be no censoring.
Actual behavior
However,
Assam
becomesA*sam
.Strangely, modifying parts of the string, such as the quotes (
"
), results in no censoring.Minimal reproducible example
Steps to reproduce
Additional context
No response
Node.js version
N/A
Obscenity version
0.2.0
Priority
Terms
The text was updated successfully, but these errors were encountered: