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
|
@ -46,6 +46,11 @@ class TXT extends Provider {
|
||||||
*/
|
*/
|
||||||
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
|
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
|
||||||
$content = $fileview->fopen($path, 'r');
|
$content = $fileview->fopen($path, 'r');
|
||||||
|
|
||||||
|
if ($content === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$content = stream_get_contents($content,3000);
|
$content = stream_get_contents($content,3000);
|
||||||
|
|
||||||
//don't create previews of empty text files
|
//don't create previews of empty text files
|
||||||
|
|
Loading…
Reference in New Issue