mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
avoid notice in mime()
This commit is contained in:
parent
dfb000fb89
commit
e1365336e2
1 changed files with 7 additions and 2 deletions
|
@ -557,9 +557,14 @@ class File {
|
||||||
}
|
}
|
||||||
if (function_exists('finfo_open')) {
|
if (function_exists('finfo_open')) {
|
||||||
$finfo = finfo_open(FILEINFO_MIME);
|
$finfo = finfo_open(FILEINFO_MIME);
|
||||||
list($type, $charset) = explode(';', finfo_file($finfo, $this->pwd()));
|
$finfo = finfo_file($finfo, $this->pwd());
|
||||||
|
if (!$finfo) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
list($type, $charset) = explode(';', $finfo);
|
||||||
return $type;
|
return $type;
|
||||||
} elseif (function_exists('mime_content_type')) {
|
}
|
||||||
|
if (function_exists('mime_content_type')) {
|
||||||
return mime_content_type($this->pwd());
|
return mime_content_type($this->pwd());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue