don't generate previews of empty txt files

This commit is contained in:
Georg Ehrke 2013-08-14 21:20:03 +02:00
parent 4b5fb08c2c
commit 623f9ec817

View file

@ -17,6 +17,10 @@ class TXT extends Provider {
$content = $fileview->fopen($path, 'r');
$content = stream_get_contents($content);
if(trim($content) === '') {
return false;
}
$lines = preg_split("/\r\n|\n|\r/", $content);
$fontSize = 5; //5px