MDL-60320 icons: Use PNG icons as the preview thumbnails

Without this change, Moodle fails to provide any data when requesting a
thumbnail for a non-image file as its looking to provide a SVG file that
doesn't exist.
This commit is contained in:
Adam Olley 2017-10-03 10:16:18 +10:30
parent d8e9a23c48
commit d12ac53512

View File

@ -2425,7 +2425,7 @@ function send_stored_file($stored_file, $lifetime=null, $filter=0, $forcedownloa
$size = 256;
}
$fileicon = file_file_icon($stored_file, $size);
send_file($CFG->dirroot.'/pix/'.$fileicon.'.svg', basename($fileicon).'.svg');
send_file($CFG->dirroot.'/pix/'.$fileicon.'.png', basename($fileicon).'.png');
} else {
// preview images have fixed cache lifetime and they ignore forced download
// (they are generated by GD and therefore they are considered reasonably safe).