diff options
author | Matt Friedman <maf675@gmail.com> | 2013-12-04 16:45:30 -0800 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2013-12-04 16:45:30 -0800 |
commit | feb4ae13f4415ceb759d0c5e8c7be47213e3fc53 (patch) | |
tree | 9ccc51c2cf6c19dab546f3a4bd27c8f3229612b7 /phpBB/includes/message_parser.php | |
parent | e179f25154d3098361bf079774a6dc92aeb4e4ab (diff) | |
download | forums-feb4ae13f4415ceb759d0c5e8c7be47213e3fc53.tar forums-feb4ae13f4415ceb759d0c5e8c7be47213e3fc53.tar.gz forums-feb4ae13f4415ceb759d0c5e8c7be47213e3fc53.tar.bz2 forums-feb4ae13f4415ceb759d0c5e8c7be47213e3fc53.tar.xz forums-feb4ae13f4415ceb759d0c5e8c7be47213e3fc53.zip |
[ticket/12060] Add event core.modify_text_for_format_display_after
Use this event to modify the text after it is parsed
PHPBB3-12060
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 22 |
1 files changed, 22 insertions, 0 deletions
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); |