summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-12-11 20:37:18 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-12-11 20:37:18 +0100
commit53400a19727f43826d016b3c360a5121a2323162 (patch)
tree88adc6e908374e1342c8a3f348c639cfdc329440 /lib
parent179be8d95c78391a7bb4cb1a283bc4887d3eea21 (diff)
downloadnextcloud-server-53400a19727f43826d016b3c360a5121a2323162.tar.gz
nextcloud-server-53400a19727f43826d016b3c360a5121a2323162.zip
Properly detect if fopen fails for txt previews
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Preview/TXT.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Preview/TXT.php b/lib/private/Preview/TXT.php
index 6fd7a5516e0..a4b7ec769c0 100644
--- a/lib/private/Preview/TXT.php
+++ b/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