Duplicate spam errors

keswick

Member
Steps to reproduce:
1) Set a string as a spam word in the admin panel.
2) Ensure your test user (not moderator or administrator) is under the maxContentSpamMessages option limit.
3) As your test user, edit the first post of a thread by the same user adding the spam word.
4) Press 'save' and you should see two errors containing the your_content_cannot_be_submitted_try_later phrase. One coming from XF\Service\Post\Preparer and another from XF\Service\Thread\Editor.

The problems is that both of those services log the same error through checkForSpam(). Then those errors are placed in the same array in XF\Service\Post\Editor::_validate which is then pushed to the user.

This was tested with all add-ons disabled.
 
Top Bottom