From f29b3beb64a4d6437b9f729621d0d1b763addc0d Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:47:03 +0200 Subject: [PATCH] Don't pass invalid streams to Imaginary Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Update Imaginary.php Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Update Imaginary.php Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- lib/private/Preview/Imaginary.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/Preview/Imaginary.php b/lib/private/Preview/Imaginary.php index 1375857c210..7b806491649 100644 --- a/lib/private/Preview/Imaginary.php +++ b/lib/private/Preview/Imaginary.php @@ -78,6 +78,9 @@ class Imaginary extends ProviderV2 { // Object store $stream = $file->fopen('r'); + if (!$stream || !is_resource($stream) || feof($stream)) { + return null; + } $httpClient = $this->service->newClient(); -- 2.39.5