diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-08-14 09:03:55 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-09-09 08:27:37 +0200 |
commit | 1af6f052d80e693d289258d490c1187a064093b9 (patch) | |
tree | be5a6a5e7ced33777f582e57a2211df32d6af60f /phpBB/includes/functions_posting.php | |
parent | d2be8e1503db3686c62b23973511c61dea7a6616 (diff) | |
download | forums-1af6f052d80e693d289258d490c1187a064093b9.tar forums-1af6f052d80e693d289258d490c1187a064093b9.tar.gz forums-1af6f052d80e693d289258d490c1187a064093b9.tar.bz2 forums-1af6f052d80e693d289258d490c1187a064093b9.tar.xz forums-1af6f052d80e693d289258d490c1187a064093b9.zip |
[ticket/13904] Load upload class using factory
PHPBB3-13904
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r-- | phpBB/includes/functions_posting.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index e91f8bb56d..75ac20a337 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -404,14 +404,14 @@ 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\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null) { global $auth, $user, $config, $db, $cache; - global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_filesystem; + global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_container; $filedata = array( 'error' => array() ); include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); - $upload = new fileupload($phpbb_filesystem); + $upload = $phpbb_container->get('files.upload'); if ($config['check_attachment_content'] && isset($config['mime_triggers'])) { @@ -433,6 +433,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage $extensions = $cache->obtain_attach_extensions((($is_message) ? false : (int) $forum_id)); $upload->set_allowed_extensions(array_keys($extensions['_allowed_'])); + /** @var \phpbb\files\filespec $file */ $file = ($local) ? $upload->local_upload($local_storage, $local_filedata, $mimetype_guesser) : $upload->form_upload($form_name, $mimetype_guesser, $plupload); if ($file->init_error()) |