"REPOSITORY/MDL-13766, use default icon for unknow file type"

This commit is contained in:
dongsheng
2009-01-15 06:53:40 +00:00
parent 74f3622699
commit 72aa74ce7c
+6 -2
View File
@@ -675,8 +675,12 @@ function mimeinfo($element, $filename) {
if (isset($mimeinfo[strtolower($match[1])][$element])) {
return $mimeinfo[strtolower($match[1])][$element];
} else {
if ($element == 'icon32' and isset($mimeinfo[strtolower($match[1])]['icon'])) {
$filename = substr($mimeinfo[strtolower($match[1])]['icon'], 0, -4);
if ($element == 'icon32') {
if (isset($mimeinfo[strtolower($match[1])]['icon'])) {
$filename = substr($mimeinfo[strtolower($match[1])]['icon'], 0, -4);
} else {
$filename = 'unknown';
}
$filename .= '-32.png';
if (file_exists($CFG->dirroot.'/pix/f/'.$filename)) {
return $filename;