aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2017-08-16 21:57:11 +0700
committerrxu <rxu@mail.ru>2017-08-16 22:38:34 +0700
commit68c3a0307de19fdefd7ae716247fffea3ee30c0c (patch)
treeafd71fa73e5ca48d7655eac68cea6517bffc8712 /phpBB/includes/message_parser.php
parent1e605efaf126f5474bb1be99e7fdaed834ebb2a0 (diff)
downloadforums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar
forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar.gz
forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar.bz2
forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar.xz
forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.zip
[ticket/15324] Add more core and template events
PHPBB3-15324
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php30
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);