mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-08 00:25:19 +02:00
Merge pull request #2769 from rxu/ticket/12884
[ticket/12884] Add core event to the function upload_attachment() * rxu/ticket/12884: [ticket/12884] Add core event to the function upload_attachment()
This commit is contained in:
commit
e226c99474
@ -405,7 +405,7 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
|
|||||||
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false, \phpbb\plupload\plupload $plupload = null)
|
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false, \phpbb\plupload\plupload $plupload = null)
|
||||||
{
|
{
|
||||||
global $auth, $user, $config, $db, $cache;
|
global $auth, $user, $config, $db, $cache;
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
|
||||||
|
|
||||||
$filedata = array(
|
$filedata = array(
|
||||||
'error' => array()
|
'error' => array()
|
||||||
@ -506,6 +506,20 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
|
|||||||
$filedata['real_filename'] = $file->get('uploadname');
|
$filedata['real_filename'] = $file->get('uploadname');
|
||||||
$filedata['filetime'] = time();
|
$filedata['filetime'] = time();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modify uploaded file before submit to the post
|
||||||
|
*
|
||||||
|
* @event core.modify_uploaded_file
|
||||||
|
* @var array filedata Array containing uploaded file data
|
||||||
|
* @var bool is_image Flag indicating if the file is an image
|
||||||
|
* @since 3.1.0-RC3
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'filedata',
|
||||||
|
'is_image',
|
||||||
|
);
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.modify_uploaded_file', compact($vars)));
|
||||||
|
|
||||||
// Check our complete quota
|
// Check our complete quota
|
||||||
if ($config['attachment_quota'])
|
if ($config['attachment_quota'])
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user