commit
f1a5ebd59d
|
@ -85,7 +85,7 @@ OCA.Sharing.PublicApp = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var img = $('<img class="publicpreview">');
|
var img = $('<img class="publicpreview">');
|
||||||
if (previewSupported === 'true' || mimetype.substr(0, mimetype.indexOf('/')) === 'image') {
|
if (previewSupported === 'true' || mimetype.substr(0, mimetype.indexOf('/')) === 'image' && mimetype !== 'image/svg+xml') {
|
||||||
img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params));
|
img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params));
|
||||||
img.appendTo('#imgframe');
|
img.appendTo('#imgframe');
|
||||||
} else if (mimetype.substr(0, mimetype.indexOf('/')) !== 'video') {
|
} else if (mimetype.substr(0, mimetype.indexOf('/')) !== 'video') {
|
||||||
|
|
|
@ -814,8 +814,18 @@ class Preview {
|
||||||
self::initProviders();
|
self::initProviders();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (self::$providers as $supportedMimeType => $provider) {
|
// FIXME: Ugly hack to prevent SVG of being returned if the SVG
|
||||||
if (preg_match($supportedMimeType, $mimeType)) {
|
// provider is not enabled.
|
||||||
|
// This is required because the preview system is designed in a
|
||||||
|
// bad way and relies on opt-in with asterisks (i.e. image/*)
|
||||||
|
// which will lead to the fact that a SVG will also match the image
|
||||||
|
// provider.
|
||||||
|
if($mimeType === 'image/svg+xml' && !array_key_exists('/image\/svg\+xml/', self::$providers)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(self::$providers as $supportedMimetype => $provider) {
|
||||||
|
if(preg_match($supportedMimetype, $mimeType)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue