summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/ReferenceController.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/Controller/ReferenceController.php b/core/Controller/ReferenceController.php
index a892de03e79..ae6aeeaa6cc 100644
--- a/core/Controller/ReferenceController.php
+++ b/core/Controller/ReferenceController.php
@@ -58,10 +58,13 @@ class ReferenceController extends Controller {
$appData = $this->appDataFactory->get('core');
$folder = $appData->getFolder('opengraph');
$file = $folder->getFile($referenceId);
+ $contentType = $reference === null || $reference->getImageContentType() === null
+ ? $file->getMimeType()
+ : $reference->getImageContentType();
$response = new DataDownloadResponse(
$file->getContent(),
$referenceId,
- $reference === null ? $file->getMimeType() : $reference->getImageContentType()
+ $contentType
);
} catch (NotFoundException|NotPermittedException $e) {
$response = new DataResponse('', Http::STATUS_NOT_FOUND);