}
// Test if content can be previewed
- type = document.getElementById('file_select').files[0].type;
- if (type.startsWith('image/') ||
- type.startsWith('audio') ||
- type.startsWith('text/plain') ||
- type.startsWith('video/'))
- {
+ type = document.getElementById('file_select').files[0].type;
+ if ((type.startsWith('image/')
+ || type.startsWith('audio')
+ || type.startsWith('text/plain')
+ || type.startsWith('video/'))
+ && !type.includes('image/svg+xml'))
+ {
document.getElementById('preview_link').href = preview_link_href;
document.getElementById('preview_link_text').innerHTML = web_root + preview_link_href;
document.getElementById('upload_finished_preview').style.display = '';
- }
+ }
}
// Direct download link
if (!empty($mime)) {
$viewable = array('image', 'video', 'audio');
$decomposed = explode('/', $mime);
- if (in_array($decomposed[0], $viewable)) {
+ if (in_array($decomposed[0], $viewable) && strpos($mime, 'image/svg+xml') === false) {
return true;
}
$viewable = array('text/plain');