Support pre-submit Spam checking #4414
rmcgirr83
commented
Aug 19, 2016
You can use the event core.posting_modify_message_text to check the text from the message parser $event['message_parser']->message
Zenju
commented
Aug 19, 2016
Yes, but you cannot report errors from "core.posting_modify_message_text", can you?
Zenju
commented
Aug 19, 2016
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
Checklist:
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.