2011-09-01 Javier Lanz <javier.lanz@artica.es>
* include/functions_filemanager.php: Improved detecting mime types Fixes: #3389654 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4886 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
be5cd13050
commit
53a52c89ef
|
@ -1,3 +1,9 @@
|
|||
2011-09-01 Javier Lanz <javier.lanz@artica.es>
|
||||
|
||||
* include/functions_filemanager.php: Improved detecting mime types
|
||||
|
||||
Fixes: #3389654
|
||||
|
||||
2011-09-01 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/incidents/incident_detail.php: fixed the entities in the name
|
||||
|
|
|
@ -100,7 +100,11 @@ if (!function_exists ('mime_content_type')) {
|
|||
finfo_close ($finfo);
|
||||
return $mimetype;
|
||||
} else {
|
||||
return 'application/octet-stream';
|
||||
$temp = exec ("file ".$filename);
|
||||
if (isset($temp) && $temp != '')
|
||||
return $temp;
|
||||
else
|
||||
return 'application/octet-stream';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -883,11 +887,11 @@ function filemanager_get_file_info ($filepath) {
|
|||
$info['mime'] = MIME_DIR;
|
||||
$info['is_dir'] = true;
|
||||
$info['size'] = 0;
|
||||
} else if (strpos ($info['mime_extend'], 'image') === 0) {
|
||||
} else if (strpos ($info['mime_extend'], 'image') !== false) {
|
||||
$info['mime'] = MIME_IMAGE;
|
||||
} else if (in_array ($info['mime_extend'], $zip_mimes)) {
|
||||
$info['mime'] = MIME_ZIP;
|
||||
} else if (strpos ($info['mime_extend'], 'text') === 0) {
|
||||
} else if (strpos ($info['mime_extend'], 'text') !== false) {
|
||||
$info['mime'] = MIME_TEXT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue