Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-11 02:25:34 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-11 02:25:34 +0400
commit51e6565aab8e522e60fc2b6815c6f81697d136f9 (patch)
treedfa3176868993d872bf1341e4578622b4cbc5a7d /lib/private/preview
parent26c0007a5ff65a718abce63939b65de0cda9c7a1 (diff)
only text/plain is now used to generate text previews
blacklist implementation remove because no longer needed
Diffstat (limited to 'lib/private/preview')
-rw-r--r--lib/private/preview/txt.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php
index 77e728eb364..4c6048c6bac 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);
@@ -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');