]> source.dussan.org Git - nextcloud-server.git/commitdiff
Preview large TXT files fix
authorNmz <nemesiz@nmz.lt>
Thu, 2 Oct 2014 09:47:39 +0000 (12:47 +0300)
committerNmz <nemesiz@nmz.lt>
Thu, 2 Oct 2014 09:47:39 +0000 (12:47 +0300)
Limit the size of the string generating the preview image for TXT files

lib/private/preview/txt.php

index 2ac77faf48b17b8d9fe30f4330bb75c093afda6a..7f01b980c0e56fb19f3f35ae459cbe150ad1ed4a 100644 (file)
@@ -34,7 +34,7 @@ class TXT extends Provider {
        public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
 
                $content = $fileview->fopen($path, 'r');
-               $content = stream_get_contents($content);
+               $content = stream_get_contents($content,3000);
 
                //don't create previews of empty text files
                if(trim($content) === '') {