From 83c2829ca840d980708150d92049f35eb5e54560 Mon Sep 17 00:00:00 2001
From: Nmz <nemesiz@nmz.lt>
Date: Thu, 2 Oct 2014 12:47:39 +0300
Subject: [PATCH] Preview large TXT files fix

Limit the size of the string generating the preview image for TXT files
---
 lib/private/preview/txt.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php
index 2ac77faf48..7f01b980c0 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) === '') {
-- 
GitLab