diff options
author | Máté Bartus <CHItA@users.noreply.github.com> | 2017-09-07 14:39:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-07 14:39:39 +0200 |
commit | 0755ae423b064d94218d5b86ba1a0311e3fa4f22 (patch) | |
tree | 7bf51f57da3eea58f40e382f6e73ebe6a9bf9e19 /phpBB/includes/message_parser.php | |
parent | 908b1c9bc9e05f35454cd963ce4bc48666041c44 (diff) | |
parent | 68c3a0307de19fdefd7ae716247fffea3ee30c0c (diff) | |
download | forums-0755ae423b064d94218d5b86ba1a0311e3fa4f22.tar forums-0755ae423b064d94218d5b86ba1a0311e3fa4f22.tar.gz forums-0755ae423b064d94218d5b86ba1a0311e3fa4f22.tar.bz2 forums-0755ae423b064d94218d5b86ba1a0311e3fa4f22.tar.xz forums-0755ae423b064d94218d5b86ba1a0311e3fa4f22.zip |
Merge pull request #4905 from rxu/ticket/15324
[ticket/15324] Add more core and template events
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index d6e36fec39..d397c0084e 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1530,7 +1530,7 @@ class parse_message extends bbcode_firstpass function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false) { global $config, $auth, $user, $phpbb_root_path, $phpEx, $db, $request; - global $phpbb_container; + global $phpbb_container, $phpbb_dispatcher; $error = array(); @@ -1598,6 +1598,20 @@ class parse_message extends bbcode_firstpass ); $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); + + /** + * Modify attachment data on submit + * + * @event core.modify_attachment_data_on_submit + * @var array attachment_data Array containing attachment data + * @since 3.2.2-RC1 + */ + $attachment_data = $this->attachment_data; + $vars = array('attachment_data'); + extract($phpbb_dispatcher->trigger_event('core.modify_attachment_data_on_submit', compact($vars))); + $this->attachment_data = $attachment_data; + unset($attachment_data); + $this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) { return '[attachment='.($match[1] + 1).']' . $match[2] . '[/attachment]'; }, $this->message); @@ -1719,6 +1733,20 @@ class parse_message extends bbcode_firstpass ); $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); + + /** + * Modify attachment data on upload + * + * @event core.modify_attachment_data_on_upload + * @var array attachment_data Array containing attachment data + * @since 3.2.2-RC1 + */ + $attachment_data = $this->attachment_data; + $vars = array('attachment_data'); + extract($phpbb_dispatcher->trigger_event('core.modify_attachment_data_on_upload', compact($vars))); + $this->attachment_data = $attachment_data; + unset($attachment_data); + $this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) { return '[attachment=' . ($match[1] + 1) . ']' . $match[2] . '[/attachment]'; }, $this->message); |