Actions
Bug #99998
closedTrying to access array offset on value of type bool in typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php line 2180
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Image Generation / GIFBUILDER
Target version:
Start date:
2023-02-21
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
From time to time we see the following php warning in out logs. Tried to reproduce it which is very hard - since we have a big distributed env.
Got error 'PHP message: TYPO3 [WARNING] request="8926f60c7cbed" component="TYPO3.CMS.Core.Type.File.ImageInfo": I could not retrieve the image size for file SITENAME/web/typo3temp/assets/images/40dc6871ee0cefaf7e6fa10a81996d0c.png - {"file":"SITENAME\\/web\\/typo3temp\\/assets\\/images\\/40dc6871ee0cefaf7e6fa10a81996d0c.png"} PHP message: TYPO3 [WARNING] request="8926f60c7cbed" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Trying to access array offset on value of type bool in typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php line 2180 PHP message: TYPO3 [WARNING] request="8926f60c7cbed" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Trying to access array offset on value of type bool in typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 194 PHP message: TYPO3 [WARNING] request="8926f60c7cbed" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Trying to access array offset on value of type bool in typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 196 PHP message: TYPO3 [WARNING] request="8926f60c7cbed" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Trying to access array offset on value of type bool in typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 197 PHP message: TYPO3 [WARNING] request="8926f60c7cbed" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Trying to access array offset on value of type bool in typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 198
We believe that it comes from a race condition in the following function
public function getImageDimensions($imageFile) { $returnArr = null; preg_match('/([^\\.]*)$/', $imageFile, $reg); if (file_exists($imageFile) && in_array(strtolower($reg[0]), $this->imageFileExt, true)) { $returnArr = $this->getCachedImageDimensions($imageFile); if (!$returnArr) { $imageInfoObject = GeneralUtility::makeInstance(ImageInfo::class, $imageFile); if ($imageInfoObject->getWidth()) { $returnArr = [ $imageInfoObject->getWidth(), $imageInfoObject->getHeight(), strtolower($reg[0]), $imageFile, ]; $this->cacheImageDimensions($returnArr); } } } return $returnArr; }
Where $this->getCachedImageDimensions($imageFile) returns false and the call to $imageInfoObject->getWidth()) yields 0 which leads to that the returnArr now contains a boolean with the value false, which results in an error in the LocalCropScaleMaskHelper class
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77913
Updated by Sybille Peters over 1 year ago
- Related to Bug #99406: Exception in LocalImageProcessor::checkForExistingTargetFile because accessing array elements without null coalese and "array" is bool (false) added
Updated by Thomas Hohn over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ced4641cf5a40cfc7324aa41a7db49b73aa7a368.
Updated by Gerrit Code Review over 1 year ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77976
Updated by Thomas Hohn over 1 year ago
- Status changed from Under Review to Resolved
Applied in changeset e03e46badf0f521b059e807d5a8fa2386fbaa920.
Actions