Properly detect if fopen fails for txt previews

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-12-11 20:37:18 +01:00
parent 179be8d95c
commit 53400a1972
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 0 deletions

View File

@ -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