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
Current Behavior
If you leave an empty line in the list of filtered words, every new post will trigger the filter.
This include setting the words list back to an empty string after previously using it. Then there's no way to use just the merge post feature as every post will trigger the filter.
Steps to Reproduce
Leave an empty line in the list of words.
Or save a word, save, then remove all words and save.
It won't happen if the newline is at the beginning or end of the list if it contains any word.
Expected Behavior
Newlines should be ignored or trigger an error on admin save.
Screenshots
If applicable, add screenshots to help explain your problem.
Output of "php flarum info", run this in terminal in your Flarum directory.
Possible solution(s)
Ignoring empty lines seem the easiest fix.
If we decide that the filter is required, then the behavior for an empty list of words should be changed when you just enabled the extension and never stored a list of words yet, to match with the behavior of setting a list of words and then removing it.
Additional Context
Here we could add a check for empty string
Bug Report
Current Behavior
If you leave an empty line in the list of filtered words, every new post will trigger the filter.
This include setting the words list back to an empty string after previously using it. Then there's no way to use just the merge post feature as every post will trigger the filter.
Steps to Reproduce
Leave an empty line in the list of words.
Or save a word, save, then remove all words and save.
It won't happen if the newline is at the beginning or end of the list if it contains any word.
Expected Behavior
Newlines should be ignored or trigger an error on admin save.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Possible solution(s)
Ignoring empty lines seem the easiest fix.
If we decide that the filter is required, then the behavior for an empty list of words should be changed when you just enabled the extension and never stored a list of words yet, to match with the behavior of setting a list of words and then removing it.
Additional Context
Here we could add a check for empty string
filter/src/Listener/AddCensorChecks.php
Lines 52 to 54 in 347c235
By the way, this could be rewritten as a
foreach
The text was updated successfully, but these errors were encountered: