From feb4ae13f4415ceb759d0c5e8c7be47213e3fc53 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:45:30 -0800 Subject: [ticket/12060] Add event core.modify_text_for_format_display_after Use this event to modify the text after it is parsed PHPBB3-12060 --- phpBB/includes/message_parser.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'phpBB/includes/message_parser.php') diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index bce6321022..3e64f17a52 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1215,6 +1215,8 @@ class parse_message extends bbcode_firstpass */ function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true) { + global $phpbb_dispatcher; + // If false, then the parsed message get returned but internal message not processed. if (!$update_this_message) { @@ -1243,6 +1245,26 @@ class parse_message extends bbcode_firstpass $this->message = bbcode_nl2br($this->message); $this->message = smiley_text($this->message, !$allow_smilies); + $text = $this->message; + $uid = $this->bbcode_uid; + + /** + * Use this event to modify the text after it is parsed + * + * @event core.modify_text_for_format_display_after + * @var string text The text to parse + * @var string uid The BBCode UID + * @var bool allow_bbcode Allow BBCodes switch + * @var bool allow_magic_url Allow magic urls switch + * @var bool allow_smilies Allow smilies switch + * @since 3.1-A3 + */ + $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_format_display_after', compact($vars))); + + $this->message = $text; + $this->bbcode_uid = $uid; + if (!$update_this_message) { unset($this->message); -- cgit v1.2.1