From: Georg Ehrke Date: Tue, 24 Sep 2013 09:00:08 +0000 (+0200) Subject: add blacklist to txt preview backend X-Git-Tag: v6.0.0alpha2~125^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=31d2048eb83d60007183cec43a54d7a112d7a3b2;p=nextcloud-server.git add blacklist to txt preview backend --- 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);