From b9cd225a5bf8b78f56d7c0a49b3342c0b20b0b11 Mon Sep 17 00:00:00 2001 From: Sascha Egerer Date: Thu, 6 Mar 2025 19:56:32 +0100 Subject: [PATCH] Ensure PlaceholderImageService returns absolute web path `PlaceholderImageService::generate()` returns an inline svg or an public url. It must be ensured that this public url is using an absolute web path. --- Classes/Service/PlaceholderImageService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/Service/PlaceholderImageService.php b/Classes/Service/PlaceholderImageService.php index 625a083..1be04d1 100644 --- a/Classes/Service/PlaceholderImageService.php +++ b/Classes/Service/PlaceholderImageService.php @@ -4,6 +4,7 @@ use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\PathUtility; use TYPO3\CMS\Core\View\ViewFactoryData; use TYPO3\CMS\Core\View\ViewFactoryInterface; use TYPO3\CMS\Fluid\View\StandaloneView; @@ -26,7 +27,7 @@ public function generate(int $width, int $height, string $format): string { $text = sprintf('%dx%d.%s', $width, $height, $format); if ($format !== 'svg') { - return $this->generateBitmap($width, $height, $format, $text); + return PathUtility::getAbsoluteWebPath($this->generateBitmap($width, $height, $format, $text)); } if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {