aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2013-09-24 11:00:08 +0200
committerGeorg Ehrke <developer@georgehrke.com>2013-09-24 11:00:08 +0200
commit31d2048eb83d60007183cec43a54d7a112d7a3b2 (patch)
tree6fa04d66044797f6513a3cc09d41fcdf242a22da
parent03eedb58fc3529d27238959415b0f2904a0695e6 (diff)
downloadnextcloud-server-31d2048eb83d60007183cec43a54d7a112d7a3b2.tar.gz
nextcloud-server-31d2048eb83d60007183cec43a54d7a112d7a3b2.zip
add blacklist to txt preview backend
-rw-r--r--lib/preview/txt.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/preview/txt.php b/lib/preview/txt.php
index a487330691e..77e728eb364 100644
--- a/lib/preview/txt.php
+++ b/lib/preview/txt.php
@@ -9,11 +9,21 @@ namespace OC\Preview;
class TXT extends Provider {
+ private static $blacklist = array(
+ 'text/calendar',
+ 'text/vcard',
+ );
+
public function getMimeType() {
return '/text\/.*/';
}
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
+ $mimetype = $fileview->getMimeType($path);
+ if(in_array($mimetype, self::$blacklist)) {
+ return false;
+ }
+
$content = $fileview->fopen($path, 'r');
$content = stream_get_contents($content);