fixed file vulnerability

This commit is contained in:
Daniel Maya 2019-12-31 11:24:54 +01:00
parent 5b346c1ed9
commit c79a4b2c01
1 changed files with 2 additions and 6 deletions

View File

@ -106,12 +106,8 @@ if (!function_exists('mime_content_type')) {
finfo_close($finfo);
return $mimetype;
} else {
$temp = exec('file '.$filename);
if (isset($temp) && $temp != '') {
return $temp;
} else {
return 'application/octet-stream';
}
error_log('Warning: Cannot find finfo_open function. Fileinfo extension is not enabled. Please add "extension=fileinfo.so" or "extension=fileinfo.dll" in your php.ini');
return 'unknown';
}
}