Bug #100853
closedPHP Warning in GifBuilder.php
100%
Description
PHP Warning: Undefined array key 3 in /data/www/sites/baden-wuerttemberg.de/shared/typo3_src/typo3_src-11.5.27/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php line 192
There are two places where $fileInfo[3] is accessed.
Should be better to set a default when $fileInfo[3] is not set.
if (! isset($fileInfo[3])){ $fileInfo[3] = ''; }
Files
Updated by Ralph Brugger over 1 year ago
The patch file looks empty.
The file has 171 Bytes:
191a192,194 > if (! isset($fileInfo[3])){ > $fileInfo[3] = ''; > }
Updated by Stefan Bürk over 1 year ago
The array key access error is weired, however I guess if that is hit there is more off than that. Because if that is needed and the public url not set, there is something broken.
Can you provide some more context to the issue ? your used TypoScript or a guide how to properly reproduce this ?
Updated by Ralph Brugger over 1 year ago
I've tried to debug it:
$fileInfo = $this->getResource($conf['file'] ?? '', $conf['file.'] ?? []);
if ($fileInfo) {
$this->combinedFileNames[] = preg_replace('/\\.[[:alnum:]]+$/', '', PathUtility::basename($fileInfo[3]));
\TYPO3\CMS\Core\Utility\DebugUtility::debug($conf);
---------------------------------------------------
file. => array(4 items) import. => array(1 item) data => 'register:bwmediathekasset_pi1_IMAGE' (35 chars) treatIdAsReference => '1' (1 chars) width => '217c' (4 chars) height => '121c' (4 chars)
The $fileInfo does not contain those array-Entries 0,1,2,3
\TYPO3\CMS\Core\Utility\DebugUtility::debug($fileInfo);
-------------------------------------------------------
origFile => '/fileadmin/_processed_/f/7/csm_VIDEON_Mediathek_DRUCK_SACHE__22_LVBW_1c7bac24ed.jpg' (83 chars) origFile_mtime => FALSE
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/+/79590
Updated by Benni Mack over 1 year ago
I created a patch for TYPO3 Core. It might be that the TypoScript code needs an update. Can you share yours?
In addition, I changed the code in the caller code to solve this properly - the image should not be used then.
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80091
Updated by Gerrit Code Review over 1 year ago
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/+/80092
Updated by Benni Mack over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 27ecaf0a4087fba8013693e8718007ef4ecbe6b5.