Not a bug Thread title is not included in content spam check

Kirby

Well-known member
Affected version
2.2.12
When checking a thread for spam, the title is not included in the message that is checked for spam:

\XF\Service\Thread\Creator
PHP:
public function checkForSpam()
{
    if ($this->thread->discussion_state == 'visible' && $this->user->isSpamCheckRequired())
    {
        $this->postPreparer->checkForSpam();
    }
}

The post preparer service only checks the post (which does not have a title), so the title is missed.

This seems inconsistent (and most likely not what a user would expect) as for example the subject of the contact form or the title of a conversation is included in content spam checks.
 
I don't believe you are correct.

From XF\Service\Post`Preparer::checkForSpam():

PHP:
if ($post->isFirstPost())
{
    $message = $thread->title . "\n" . $post->message;
    $contentType = 'thread';
    $contentId = $thread->thread_id;
}
else
{
    $message = $post->message;
    $contentType = 'post';
    $contentId = $post->post_id;
}
 
Back
Top Bottom