aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-09-20 12:36:52 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-10-09 09:46:11 +0200
commit16d5208d9aec0678b3295b0e14042991094197ba (patch)
treeb8e03212cda91774a257a63850afa13a0fed5fda /phpBB/includes/message_parser.php
parenta60beb6f2f9d75e34c67a53c9b2332e15fe21b4a (diff)
downloadforums-16d5208d9aec0678b3295b0e14042991094197ba.tar
forums-16d5208d9aec0678b3295b0e14042991094197ba.tar.gz
forums-16d5208d9aec0678b3295b0e14042991094197ba.tar.bz2
forums-16d5208d9aec0678b3295b0e14042991094197ba.tar.xz
forums-16d5208d9aec0678b3295b0e14042991094197ba.zip
[ticket/14168] Use attachment upload class in message_parser
PHPBB3-14168
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php27
1 files changed, 7 insertions, 20 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 31fc1577a2..e0a0d69fba 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1141,12 +1141,6 @@ class parse_message extends bbcode_firstpass
protected $plupload;
/**
- * The mimetype guesser object used for attachment mimetypes
- * @var \phpbb\mimetype\guesser
- */
- protected $mimetype_guesser;
-
- /**
* Init - give message here or manually
*/
function parse_message($message = '')
@@ -1541,6 +1535,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;
$error = array();
@@ -1576,7 +1571,9 @@ class parse_message extends bbcode_firstpass
{
if ($num_attachments < $cfg['max_attachments'] || $auth->acl_get('a_') || $auth->acl_get('m_', $forum_id))
{
- $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message);
+ /** @var \phpbb\attachment\upload $attachment_upload */
+ $attachment_upload = $phpbb_container->get('attachment.upload');
+ $filedata = $attachment_upload->upload($form_name, $forum_id, false, '', $is_message);
$error = $filedata['error'];
if ($filedata['post_attach'] && !sizeof($error))
@@ -1692,7 +1689,9 @@ class parse_message extends bbcode_firstpass
{
if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_', $forum_id))
{
- $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message, false, $this->mimetype_guesser, $this->plupload);
+ /** @var \phpbb\attachment\upload $attachment_upload */
+ $attachment_upload = $phpbb_container->get('attachment.upload');
+ $filedata = $attachment_upload->upload($form_name, $forum_id, false, '', $is_message);;
$error = array_merge($error, $filedata['error']);
if (!sizeof($error))
@@ -1981,18 +1980,6 @@ class parse_message extends bbcode_firstpass
}
/**
- * Setter function for passing the mimetype_guesser object
- *
- * @param \phpbb\mimetype\guesser $mimetype_guesser The mimetype_guesser object
- *
- * @return null
- */
- public function set_mimetype_guesser(\phpbb\mimetype\guesser $mimetype_guesser)
- {
- $this->mimetype_guesser = $mimetype_guesser;
- }
-
- /**
* Function to perform custom bbcode validation by extensions
* can be used in bbcode_init() to assign regexp replacement
* Example: 'regexp' => array('#\[b\](.*?)\[/b\]#uise' => "\$this->validate_bbcode_by_extension('\$1')")