As designed Spam filter ignoring "Manually approve" for posts

thedude

Well-known member
We have our spam phrase settings (admin.php?options/list/spam) set to put threads and posts in moderation if they contain certain phrases, and the user has < x number of posts.

While we would get new threads in the moderation queue that had triggered the filter, we also were getting complaints of new users seeing the following message
Your content can not be submitted. This is likely because your content is spam-like or contains inappropriate elements. Please change your content or try again later. If you still have problems, please contact an administrator.
when editing their existing posts.

So after some digging we found a discrepency...

In XenForo_ControllerPublic_Thread::actionAddReply, and XenForo_ControllerPublic_Forum::actionAddThread:
Code:
switch ($spamModel->checkMessageSpam($input['message'], $spamExtraParams, $this->_request))
            {
                case XenForo_Model_SpamPrevention::RESULT_MODERATED:
                    $writer->set('message_state', 'moderated');
                    break;

                case XenForo_Model_SpamPrevention::RESULT_DENIED;
                    $spamModel->logSpamTrigger('post', null);
                    $writer->error(new XenForo_Phrase('your_content_cannot_be_submitted_try_later'));
                    break;
            }

However in XenForo_ControllerPublic_Post::actionSave and XenForo_ControllerPublic_Post::actionSaveInline:
Code:
switch ($spamModel->checkMessageSpam($input['message'], $spamExtraParams, $this->_request))
            {
                case XenForo_Model_SpamPrevention::RESULT_MODERATED:
                case XenForo_Model_SpamPrevention::RESULT_DENIED;
                    $spamModel->logSpamTrigger('post', $post['post_id']);
                    $dw->error(new XenForo_Phrase('your_content_cannot_be_submitted_try_later'));
                    break;
            }

If you create or reply to a thread, and you trigger the spam phrase catcher, it'll honor your choice to go to moderation (if you selected that in the AdminCP). If you edit an existing post and trigger the spam phrase catcher, it won't honor the moderation choice and just reject it outright, which is very confusing for the user (and violates the option chosen by the admin).
 
This is basically as designed. There are some options that don't really support moderation -- a good example would be signatures and conversations, though also post editing as we don't send things back to moderation through it.
 
This is basically as designed. There are some options that don't really support moderation -- a good example would be signatures and conversations, though also post editing as we don't send things back to moderation through it.
Fair enough.

Then the descriptive text for that option should indicate that manual approval will only occur for new threads and replies to threads, and edited posts will always be rejected if they contain one of the spam phrases within the specified post count.

It's easy to see how one can be mislead by the way it's shown at the moment.
Screenshot_2015-06-01-02-47-26~01.webp
 
Last edited:
Back
Top Bottom