Skip to content

Commit

Permalink
[BUGFIX] Ensure extension icon exists before calling ImageInfo
Browse files Browse the repository at this point in the history
As the extension icon is not required, this patch prevents warnings
that are triggered because no image size can be fetched.

Resolves: #85363
Releases: master, 8.7
Change-Id: I4c98fbaed385b2f269e940b8531c45e948ab8d36
Reviewed-on: https://review.typo3.org/57393
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
  • Loading branch information
IchHabRecht committed Jun 28, 2018
1 parent 0c5436a commit 3ce9cc7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php
Expand Up @@ -271,9 +271,14 @@ public function enrichExtensionsWithIconInformation(array $extensions)
{
foreach ($extensions as &$properties) {
$extIconPath = Environment::getPublicPath() . '/' . $properties['siteRelPath'] . $properties['ext_icon'];
$imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $extIconPath);
$properties['ext_icon_width'] = $imageInfo->getWidth();
$properties['ext_icon_height'] = $imageInfo->getHeight();
if (@is_file($extIconPath)) {
$imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $extIconPath);
$properties['ext_icon_width'] = $imageInfo->getWidth();
$properties['ext_icon_height'] = $imageInfo->getHeight();
} else {
$properties['ext_icon_width'] = 0;
$properties['ext_icon_height'] = 0;
}
}
unset($properties);
return $extensions;
Expand Down

0 comments on commit 3ce9cc7

Please sign in to comment.