diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-10-23 18:34:06 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-10-23 18:34:06 +0200 |
commit | 789d49359510f10c68be61eaa56d77b3ab428328 (patch) | |
tree | ce556ce9fc62b58a31c4de5ac31f93cf97f5e330 /phpBB/phpbb/plupload/plupload.php | |
parent | d612041cd19d5bea7d08f80a2d952123699aa30e (diff) | |
download | forums-789d49359510f10c68be61eaa56d77b3ab428328.tar forums-789d49359510f10c68be61eaa56d77b3ab428328.tar.gz forums-789d49359510f10c68be61eaa56d77b3ab428328.tar.bz2 forums-789d49359510f10c68be61eaa56d77b3ab428328.tar.xz forums-789d49359510f10c68be61eaa56d77b3ab428328.zip |
[ticket/11912] Integrate mimetype guesser with plupload
PHPBB3-11912
Diffstat (limited to 'phpBB/phpbb/plupload/plupload.php')
-rw-r--r-- | phpBB/phpbb/plupload/plupload.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 6eb5adf864..29a4aff39b 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -50,6 +50,11 @@ class plupload protected $php_ini; /** + * @var \phpbb\mimetype\guesser + */ + protected $mimetype_guesser; + + /** * Final destination for uploaded files, i.e. the "files" directory. * @var string */ @@ -69,16 +74,18 @@ class plupload * @param \phpbb\request\request_interface $request * @param \phpbb\user $user * @param \phpbb\php\ini $php_ini + * @param \phpbb\mimetype\guesser $mimetype_guesser * * @return null */ - public function __construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \phpbb\php\ini $php_ini) + public function __construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \phpbb\php\ini $php_ini, \phpbb\mimetype\guesser $mimetype_guesser) { $this->phpbb_root_path = $phpbb_root_path; $this->config = $config; $this->request = $request; $this->user = $user; $this->php_ini = $php_ini; + $this->mimetype_guesser = $mimetype_guesser; $this->upload_directory = $this->phpbb_root_path . $this->config['upload_path']; $this->temporary_directory = $this->upload_directory . '/plupload'; @@ -128,7 +135,7 @@ class plupload 'tmp_name' => $file_path, 'name' => $this->request->variable('real_filename', ''), 'size' => filesize($file_path), - 'type' => $file_info->getMimeType($file_path), + 'type' => $this->mimetype_guesser->guess($file_path), ); } else |