mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15276] Use finfo to get mimetype
PHPBB3-15276
This commit is contained in:
parent
400e663347
commit
090ed9bf79
1 changed files with 11 additions and 1 deletions
|
@ -275,6 +275,16 @@ class local implements adapter_interface, stream_interface
|
||||||
*/
|
*/
|
||||||
public function file_mimetype($path)
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue