summaryrefslogtreecommitdiffstats
path: root/lib/private/preview/txt.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/preview/txt.php')
-rw-r--r--lib/private/preview/txt.php35
1 files changed, 12 insertions, 23 deletions
diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php
index 77e728eb364..c9aa20968d8 100644
--- a/lib/private/preview/txt.php
+++ b/lib/private/preview/txt.php
@@ -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);
@@ -62,22 +61,12 @@ class TXT extends Provider {
\OC\Preview::registerProvider('OC\Preview\TXT');
-class PHP extends TXT {
-
- public function getMimeType() {
- return '/application\/x-php/';
- }
-
-}
-
-\OC\Preview::registerProvider('OC\Preview\PHP');
-
-class JavaScript extends TXT {
+class MarkDown extends TXT {
public function getMimeType() {
- return '/application\/javascript/';
+ return '/text\/(x-)?markdown/';
}
}
-\OC\Preview::registerProvider('OC\Preview\JavaScript'); \ No newline at end of file
+\OC\Preview::registerProvider('OC\Preview\MarkDown');