Properly detect if fopen fails for txt previews

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/7453/head
Roeland Jago Douma 8 years ago
parent 179be8d95c
commit 53400a1972
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 5
      lib/private/Preview/TXT.php

@ -46,6 +46,11 @@ class TXT extends Provider {
*/
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
$content = $fileview->fopen($path, 'r');
if ($content === false) {
return false;
}
$content = stream_get_contents($content,3000);
//don't create previews of empty text files

Loading…
Cancel
Save