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:
javilanz 2011-09-01 18:03:01 +00:00
parent be5cd13050
commit 53a52c89ef
2 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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;
}