Add core event to the function parse() in includes/message_parser.php to allow additional handling message before parsing (i.e. perform custom message checks, cleanup etc.). PHPBB3-13294