From eaa4c908b19a7c80051dcff4d52c8e62d6a9f8f9 Mon Sep 17 00:00:00 2001 From: "mathias.uhlmann" Date: Fri, 16 Aug 2019 11:09:19 +0200 Subject: [PATCH] [BUGFIX] Prevent value null for title and alt attributes --- Classes/Controller/SelectImageController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Controller/SelectImageController.php b/Classes/Controller/SelectImageController.php index d8b0236..258eda7 100644 --- a/Classes/Controller/SelectImageController.php +++ b/Classes/Controller/SelectImageController.php @@ -90,8 +90,8 @@ public function infoAction(ServerRequestInterface $request): ResponseInterface return new JsonResponse([ 'uid' => $file->getUid(), - 'alt' => $file->getProperty('alternative'), - 'title' => $file->getProperty('title'), + 'alt' => empty($file->getProperty('alternative')) ? "" : $file->getProperty('alternative'), + 'title' => empty($file->getProperty('title')) ? "" : $file->getProperty('title'), 'width' => $file->getProperty('width'), 'height' =>$file->getProperty('height'), 'url' => $this->prettifyImgUrl($processedFile->getPublicUrl()),