mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge remote-tracking branch 'github-marc1706/ticket/11148' into develop-ascraeus
* github-marc1706/ticket/11148: [ticket/11148] Remove unneeded variable mimetype and use type octet-stream [ticket/11148] Change expected output with disallowed content in test [ticket/11148] Always use the output of the mimetype guesser in get_mimetype [ticket/11148] Get rid of extra line in mimetype guesser setter doc block [ticket/11148] Add missing parts to docblock of get_mimetype() method [ticket/11148] Default to application/octet-stream if no mimetype given [ticket/11148] Use mimetype guesser for uploaded avatars [ticket/11148] Pass mimetype guesser to upload_attachment() function [ticket/11148] Add mimetype guesser to filespec and fileupload class
This commit is contained in:
@@ -1082,6 +1082,12 @@ 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
|
||||
*/
|
||||
@@ -1560,7 +1566,7 @@ 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->plupload);
|
||||
$filedata = upload_attachment($form_name, $forum_id, false, '', $is_message, false, $this->mimetype_guesser, $this->plupload);
|
||||
$error = array_merge($error, $filedata['error']);
|
||||
|
||||
if (!sizeof($error))
|
||||
@@ -1792,4 +1798,16 @@ class parse_message extends bbcode_firstpass
|
||||
{
|
||||
$this->plupload = $plupload;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user