diff --git a/phpBB/phpbb/storage/adapter/local.php b/phpBB/phpbb/storage/adapter/local.php index 34c2894569..2855dcf7d1 100644 --- a/phpBB/phpbb/storage/adapter/local.php +++ b/phpBB/phpbb/storage/adapter/local.php @@ -275,6 +275,16 @@ class local implements adapter_interface, stream_interface */ public function file_mimetype($path) { - return mime_content_type($this->root_path . $path); + if (class_exists('finfo')) + { + $finfo = new \finfo(FILEINFO_MIME_TYPE); + $mimetype = $finfo->file($this->root_path . $path); + } + else + { + $mimetype = mime_content_type($this->root_path . $path); + } + + return $mimetype; } }