diff options
-rw-r--r-- | phpBB/phpbb/avatar/driver/upload.php | 14 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 27 |
2 files changed, 41 insertions, 0 deletions
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index e44157294c..cb8dfcad4f 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -167,17 +167,29 @@ class upload extends \phpbb\avatar\driver\driver $destination = ''; } + $filedata = array( + 'filename' => $file->get('filename'), + 'filesize' => $file->get('filesize'), + 'mimetype' => $file->get('mimetype'), + 'extension' => $file->get('extension'), + 'physical_filename' => $file->get('realname'), + 'real_filename' => $file->get('uploadname'), + ); + /** * Before moving new file in place (and eventually overwriting the existing avatar with the newly uploaded avatar) * * @event core.avatar_driver_upload_move_file_before + * @var array filedata Array containing uploaded file data * @var string destination Destination directory where the file is going to be moved * @var string prefix Prefix for the avatar filename * @var array row Array with avatar row data * @var array error Array of errors, if filled in by this event file will not be moved * @since 3.1.6-RC1 + * @changed 3.1.9-RC1 Added filedata */ $vars = array( + 'filedata', 'destination', 'prefix', 'row', @@ -185,6 +197,8 @@ class upload extends \phpbb\avatar\driver\driver ); extract($this->dispatcher->trigger_event('core.avatar_driver_upload_move_file_before', compact($vars))); + unset($filedata); + if (!sizeof($error)) { // Move file and overwrite any existing image diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index fcc44abc33..eeb6444ceb 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -588,6 +588,33 @@ $quickmod_array = array( 'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)), ); +/** +* Event to modify data in the quickmod_array before it gets sent to the +* phpbb_add_quickmod_option function. +* +* @event core.viewtopic_add_quickmod_option_before +* @var int forum_id Forum ID +* @var int post_id Post ID +* @var array quickmod_array Array with quick moderation options data +* @var array topic_data Array with topic data +* @var int topic_id Topic ID +* @var array topic_tracking_info Array with topic tracking data +* @var string viewtopic_url URL to the topic page +* @var bool allow_change_type Topic change permissions check +* @since 3.1.9-RC1 +*/ +$vars = array( + 'forum_id', + 'post_id', + 'quickmod_array', + 'topic_data', + 'topic_id', + 'topic_tracking_info', + 'viewtopic_url', + 'allow_change_type', +); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_add_quickmod_option_before', compact($vars))); + foreach ($quickmod_array as $option => $qm_ary) { if (!empty($qm_ary[1])) |