aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-10-17 12:01:27 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-10-17 12:01:27 +0200
commitf1a5ebd59d5403cdae1ed60513c9feb469365d09 (patch)
treec7d7a342797859e53a1edb3f59a218b90b01beb4 /lib
parent276db93daceda7498a262f1f56cb24104d26ac76 (diff)
parent4deb57bfaeacd2eee510ee37797d5e9b504d9888 (diff)
downloadnextcloud-server-f1a5ebd59d5403cdae1ed60513c9feb469365d09.tar.gz
nextcloud-server-f1a5ebd59d5403cdae1ed60513c9feb469365d09.zip
Merge pull request #11611 from owncloud/fix-svg-master
Fix SVG icons
Diffstat (limited to 'lib')
-rwxr-xr-xlib/private/preview.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index e9bfb3b9285..f8b19f11cb0 100755
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -814,8 +814,18 @@ class Preview {
self::initProviders();
}
- foreach (self::$providers as $supportedMimeType => $provider) {
- if (preg_match($supportedMimeType, $mimeType)) {
+ // FIXME: Ugly hack to prevent SVG of being returned if the SVG
+ // 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;
}
}