From 935430c3e3441dd8ff8caa5cb969e3e5014dcd17 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 13 Mar 2022 07:52:00 +0000 Subject: [PATCH] fix preview output when no output param and type doesn't exist --- app/controllers/api/storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 314e255845..90f6730142 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -951,7 +951,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $data = $cache->load($key, 60 * 60 * 24 * 30 * 3/* 3 months */); if ($data) { - $output = (empty($output)) ? $type : $output; + $output = (empty($output)) ? ( empty($type) ? 'jpg' : $type ) : $output; return $response ->setContentType((\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg'])