[BUGFIX] Avoid registering extension icons in IconRegistry 28/55828/4
authorOliver Hader <oliver@typo3.org>
Tue, 20 Feb 2018 15:42:31 +0000 (16:42 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 20 Feb 2018 20:54:38 +0000 (21:54 +0100)
Extensions usually have an individual icon that can be loaded
from Resources/Public/Icons/Extension.*. For some system extensions
IconRegistry automatically registers icons available in the file
system. This leads to the fact that the "Extension.*"
icon of some extensions is registered multiple times.

Resolves: #83979
Releases: master
Change-Id: I1d2d02a5bbadd33d8d6abeefff0c2071193dbdf0
Reviewed-on: https://review.typo3.org/55828
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Imaging/IconRegistry.php

index 342b116..efa23ce 100644 (file)
@@ -71,7 +71,7 @@ class IconRegistry implements SingletonInterface
         'EXT:backend/Resources/Public/Icons/',
         'EXT:core/Resources/Public/Icons/T3Icons/',
         'EXT:impexp/Resources/Public/Icons/',
-        'EXT:install/Resources/Public/Icons'
+        'EXT:install/Resources/Public/Icons/'
     ];
 
     /**
@@ -612,6 +612,11 @@ class IconRegistry implements SingletonInterface
                 ->name('/\.(' . implode('|', array_keys($this->backendIconAllowedExtensionsWithProvider)) . ')$/');
 
             foreach ($finder as $iconFile) {
+                // ignore icons that are used as extension icon in extension manager
+                // @see ExtensionManagementUtility::getExtensionIcon()
+                if (strpos($iconFile->getRelativePathname(), 'Extension.') === 0) {
+                    continue;
+                }
                 $iconOptions = [
                     'source' => $iconPath . GeneralUtility::fixWindowsFilePath($iconFile->getRelativePathname())
                 ];