From: Nmz Date: Thu, 2 Oct 2014 09:47:39 +0000 (+0300) Subject: Preview large TXT files fix X-Git-Tag: v8.0.0alpha1~570^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=83c2829ca840d980708150d92049f35eb5e54560;p=nextcloud-server.git Preview large TXT files fix Limit the size of the string generating the preview image for TXT files --- diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php index 2ac77faf48b..7f01b980c0e 100644 --- a/lib/private/preview/txt.php +++ b/lib/private/preview/txt.php @@ -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) === '') {