Skip to content

Commit

Permalink
[BUGFIX] Avoid PHP error in PHP 8 context in GifBuilder
Browse files Browse the repository at this point in the history
Resolves: #100853
Releases: main, 12.4, 11.5
Change-Id: I8a1284c2c859cde9d114fecbbe9c5a1e38a35c94
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79590
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Frank N�gler <frank.naegler@typo3.com>
Reviewed-by: Stefan B�rk <stefan@buerk.tech>
Tested-by: Frank N�gler <frank.naegler@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Stefan B�rk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
bmack authored and lolli42 committed Jul 19, 2023
1 parent 0a8d164 commit 27ecaf0
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -3756,10 +3756,12 @@ public function getImgResource($file, $fileArray)
try {
$theImage = GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize($file);
$info = GeneralUtility::makeInstance(GifBuilder::class)->imageMagickConvert($theImage, 'WEB');
$info['origFile'] = $theImage;
// This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, ln 100ff in order for the setup-array to create a unique filename hash.
$info['origFile_mtime'] = @filemtime(Environment::getPublicPath() . '/' . $theImage);
$imageResource = $info;
if ($info !== null) {
$info['origFile'] = $theImage;
// This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, ln 100ff in order for the setup-array to create a unique filename hash.
$info['origFile_mtime'] = @filemtime(Environment::getPublicPath() . '/' . $theImage);
$imageResource = $info;
}
} catch (Exception $e) {
// do nothing in case the file path is invalid
}
Expand Down

0 comments on commit 27ecaf0

Please sign in to comment.