fix: use `wp_check_filetype` to get a mime type if module FINFO not present
This commit is contained in:
parent
daa0a67aed
commit
e842645b5c
|
@ -188,7 +188,8 @@ class Media {
|
|||
finfo_close( $finfo );
|
||||
return $mime_type;
|
||||
}
|
||||
return '';
|
||||
$filetypes = \wp_check_filetype($filename);
|
||||
return isset($filetypes['type']) && $filetypes['type'] != false ? $filetypes['type'] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,13 +13,13 @@ class Private_Files {
|
|||
|
||||
public $dir_separator;
|
||||
|
||||
public static function get_instance() {
|
||||
if(!isset(self::$instance)) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
public static function get_instance() {
|
||||
if(!isset(self::$instance)) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
protected function __construct() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue