mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Properly detect if fopen fails for txt previews
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
179be8d95c
commit
53400a1972
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Reference in a new issue