]> source.dussan.org Git - nextcloud-server.git/commitdiff
only text/plain is now used to generate text previews
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 10 Oct 2013 22:25:34 +0000 (00:25 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 10 Oct 2013 22:25:34 +0000 (00:25 +0200)
blacklist implementation remove because no longer needed

lib/private/preview/txt.php

index 77e728eb3644d41476f2c38e3e07c0c5bd10388d..4c6048c6bac1a8544fb72df90e454ad0318b64bd 100644 (file)
@@ -9,20 +9,19 @@ namespace OC\Preview;
 
 class TXT extends Provider {
 
-       private static $blacklist = array(
-               'text/calendar',
-               'text/vcard',
-       );
-
        public function getMimeType() {
-               return '/text\/.*/';
+               return '/text\/plain/';
        }
 
+       /**
+        * @param string $path
+        * @param int $maxX
+        * @param int $maxY
+        * @param boolean $scalingup
+        * @param \OC\Files\View $fileview
+        * @return bool|\OC_Image
+        */
        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);
@@ -80,4 +79,4 @@ class JavaScript extends TXT {
 
 }
 
-\OC\Preview::registerProvider('OC\Preview\JavaScript');
\ No newline at end of file
+\OC\Preview::registerProvider('OC\Preview\JavaScript');