diff --git a/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php b/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php index 2e467f5688ae38d2078dc86fd128cf5c96a98341..f9b90dd321e946a605b9069c04a9ed659e56c5ea 100644 --- a/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php +++ b/typo3/sysext/reports/Classes/ViewHelpers/IconViewHelper.php @@ -14,8 +14,8 @@ namespace TYPO3\CMS\Reports\ViewHelpers; * The TYPO3 project - inspiring people to share! */ -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\PathUtility; use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; @@ -64,14 +64,7 @@ class IconViewHelper extends AbstractBackendViewHelper $icon = $arguments['icon']; $title = $arguments['title']; - if (!empty($icon)) { - $absIconPath = GeneralUtility::getFileAbsFileName($icon); - if (file_exists($absIconPath)) { - $icon = '../' . str_replace(PATH_site, '', $absIconPath); - } - } else { - $icon = ExtensionManagementUtility::extRelPath('reports') . 'ext_icon.png'; - } - return '<img src="' . htmlspecialchars($icon) . '" width="16" height="16" title="' . htmlspecialchars($title) . '" alt="' . htmlspecialchars($title) . '" />'; + $icon = GeneralUtility::getFileAbsFileName($icon ?: 'EXT:reports/ext_icon.png'); + return '<img src="' . htmlspecialchars(PathUtility::getAbsoluteWebPath($icon)) . '" width="16" height="16" title="' . htmlspecialchars($title) . '" alt="' . htmlspecialchars($title) . '" />'; } }