From a80710657ee28d793399174f229e05edc1f6d0a0 Mon Sep 17 00:00:00 2001 From: Achim Fritz Date: Fri, 24 May 2024 14:06:34 +0200 Subject: [PATCH] [BUGFIX] SVG Rendering --- Build/phpstan11.neon | 2 + Classes/AssetCollector.php | 25 +++++++++++-- .../Frontend/Fixtures/SvgViewHelper.csv | 11 ++++++ .../Fixtures/Templates/SvgViewHelper.html | 9 +++++ .../Functional/Frontend/SvgViewHelperTest.php | 37 +++++++++++++++++++ 5 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 Tests/Functional/Frontend/Fixtures/SvgViewHelper.csv create mode 100644 Tests/Functional/Frontend/Fixtures/Templates/SvgViewHelper.html create mode 100644 Tests/Functional/Frontend/SvgViewHelperTest.php diff --git a/Build/phpstan11.neon b/Build/phpstan11.neon index 649a756..c77cdb9 100644 --- a/Build/phpstan11.neon +++ b/Build/phpstan11.neon @@ -6,3 +6,5 @@ parameters: - %currentWorkingDirectory%/Classes excludePaths: - %currentWorkingDirectory%/Classes/Listener/AfterCacheableContentIsGenerated.php + ignoreErrors: + - '#.*unknown class TYPO3\\CMS\\Core\\TypoScript\\FrontendTypoScript.#' diff --git a/Classes/AssetCollector.php b/Classes/AssetCollector.php index 880d9df..6887443 100644 --- a/Classes/AssetCollector.php +++ b/Classes/AssetCollector.php @@ -13,8 +13,10 @@ */ use B13\Assetcollector\Resource\ResourceCompressor; +use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScript; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\PathUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -218,6 +220,7 @@ public function buildInlineXmlTag(): string . ''; } } + if (trim($inlineXml) !== '') { return '