Skip to content

Commit

Permalink
[ticket/15276] Use finfo to get mimetype
Browse files Browse the repository at this point in the history
PHPBB3-15276
  • Loading branch information
rubencm committed Aug 9, 2017
1 parent 9c6026b commit de37630
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion phpBB/phpbb/storage/adapter/local.php
Expand Up @@ -274,6 +274,16 @@ public function file_size($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;
}
}

0 comments on commit de37630

Please sign in to comment.