diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-10-20 09:13:26 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-10-20 09:13:26 +0200 |
commit | 55573645c6ebcbe3710150b55a94fe117c476a2d (patch) | |
tree | 1b515a9764a19cedb2d24b0ee2eadfd477061286 /lib/private | |
parent | de8c624a1582b80030966bf50ec5b9cc0bcee900 (diff) | |
parent | 979d2823b532446d6c5ef24717178f3533fda1c3 (diff) | |
download | nextcloud-server-55573645c6ebcbe3710150b55a94fe117c476a2d.tar.gz nextcloud-server-55573645c6ebcbe3710150b55a94fe117c476a2d.zip |
Merge pull request #11371 from owncloud/backport-11368
Load public preview via JS
Diffstat (limited to 'lib/private')
-rwxr-xr-x | lib/private/preview.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php index c2e67bf6329..4980c43342c 100755 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -660,6 +660,16 @@ class Preview { self::initProviders(); } + // 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; + } + //remove last element because it has the mimetype * foreach(self::$providers as $supportedMimetype => $provider) { if(preg_match($supportedMimetype, $mimetype)) { |