Support pre-submit Spam checking #4414

Open
wants to merge 1 commit into
from

2 participants

@Zenju

Checklist:

  • Correct branch: master for new features; 3.2.x, 3.1.x for fixes
  • Tests pass
  • Code follows coding guidelines: master / 3.2.x, 3.1.x
  • Commit follows commit message format

Tracker ticket (set the ticket ID to your ticket ID):

https://tracker.phpbb.com/browse/PHPBB3-12345

Why is the message text being removed? The subsequent "core.posting_modify_submission_errors" then has no way to check the message for spam.
The next events, e.g. "core.posting_modify_submit_post_before" OTOH have this message from "'message' => $message_parser->message,", but they are not allowed to notify an error condition. So it's a catch 22.
Best solution would be to allow "core.posting_modify_submission_errors" to check the message.

@Zenju Zenju Support pre-submit Spam checking
Why is the message text being removed? The subsequent "core.posting_modify_submission_errors" then has no way to check the message for spam.
The next events, e.g. "core.posting_modify_submit_post_before" OTOH *have* this message from "'message' => $message_parser->message,", but they are not allowed to notify an error condition. So it's a catch 22.
Best solution would be to allow "core.posting_modify_submission_errors" to check the message.
a8757c7
@rmcgirr83

You can use the event core.posting_modify_message_text to check the text from the message parser $event['message_parser']->message

@Zenju

Yes, but you cannot report errors from "core.posting_modify_message_text", can you?

@Zenju

Ah, so it seems that message parser warnings are treated as errors in posting.php later on, so this will probably work. Still this feels more like a hack, when there is a "core.posting_modify_submission_errors" which seems to be the right place to check for errors, but which is only missing the message text as input.
Maybe just adding a "msg_text" variable to this event, or even the full "message_parser" would be the best solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment